I'm having issues when dynamically assigning text colors to some headings. I have a .map function that runs and outputs some divs with different heading colors. This is example of my code:
{nftInfo.map((nft, index) => (
<div
className="flex flex-col space-y-3 rounded-lg border-2 border-opacity-25 bg-white p-5 hover:bg-slate-50 dark:border-slate-500 dark:bg-gray-700"
key={index}
>
<div
className={`flex justify-center space-x-4 font-bold text-${nft.color}-600 dark:text-${nft.color}-400`}
>
<div className={`text-lg `}>
{nft.title} {nft.color} <--- This outputs the correct color
</div>
{nft.icon}
</div>
</div>
Example of JSON:
{
title: 'Dummy text 2',
description: 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Maxime minima odit aspernatur aliquam deleniti in corporis omnis cupiditate optio, voluptatum quasi reiciendis dolor, nostrum nihil quaerat est, doloremque mollitia possimus.',
bottomText: 'Lorem ipsum dolor sit amet consectetur adipisicing',
buttonText: 'Generate contract',
icon: <CodeIcon className="mt-1 h-6 w-6" />,
color: 'pink'
}
Here you can see that I'm assigning text colors depending on the color I set in the JSON above.
text-${nft.color}-600 dark:text-${nft.color}-400
I can also see the string being correctly assigned in the developer tools DOM view, but when I check the CSS in the dev tools the style is not applied...
Also, if I manually add the class to the div the heading does get colored...

