The custom colors configured in tailwind.config.js is not working, when I assigned to a variable and use it as shown below.
where button.colour = "custom-blue" ( Colour data is fetched from the cms and can be set in cms )
<button class="inline-block px-6 py-2.5 bg-${button.colour} text-custom-dark-blue font-medium text-sm leading-tight rounded shadow-md hover:bg-white hover:border-2 border-custom-blue hover:text-${button.colour}">Submit</button>
But the below code works perfectly fine.
<button class="inline-block px-6 py-2.5 bg-custom-blue text-custom-dark-blue font-medium text-sm leading-tight rounded shadow-md hover:bg-white hover:border-2 border-custom-blue hover:text-custom-blue">Submit</button>
tailwind.config.js file:
module.exports = {
content: [
'./pages/**/*.{js,ts,jsx,tsx}',
'./components/**/*.{js,ts,jsx,tsx}'
]
,
theme: {
extend: {
colors: {
'custom-blue':'#4AD7D1',
},
},
},
plugins: [],
important: true
}
How to resolve this issue?