Dynamically setting the color in TailwindCSS.

I am working with Next.js and Tailwind CSS and using Context API to set the theme of my webpage dynamically. I have a color palette of 8 colors.
But
hover:${themeColor.bg.base} is not working with hover, otherwise the color is working fine.
themeColor.hover.base actually points to bg-themeColor2Base, and themeColor2Base is defined in tailwind.config.css.
Was this page helpful?