I am trying to use custom color names defined in my tailwind.config.js
in namespace data.datasets.backgroundColor
for my doughnut chart component in react-chartjs-2. However, it is not working. Is there some way I can easily use the Tailwind names without having to use their hex values?
FYI, it works perfectly with the hex values, but I was just wondering if there's a way to just use the Tailwind names.
Custom colors defined in tailwind.config.js
:
cc1: '#0099CC',
cc2: '#ED1A37',
My chart.js data
variable:
const data = {
labels: ...
datasets: [
{
data: ...
backgroundColor: ['cc1', 'cc2']
offset: ...
},
],
};
// backgroundColor is invalid