Closed miczed closed 4 years ago
I definitely should have read the documentation more carefully, my bad. In case anyone is interested, I achieved the desired behavior by adding the following to my config:
module.exports = {
theme: {
customForms: theme => ({
default: {
checkbox: {
iconColor: theme('colors.gray.600'), // changes the default color of the icon
'&.correct': {
iconColor: theme('colors.green.500'), // 'input.correct' will change the color of the icon to green
},
'&.wrong': {
iconColor: theme('colors.red.500'), // 'input.wrong' will change the color of the icon to red
}
}
}
}
}
}
I ran into a situation today where I wanted to change the color of the tick icon that is rendered within the checkbox when it is checked. Since we're able to change the background color using the
bg-{color}
classes wouldn't it be nice if the tick itself could be styled by using thetext-{color}
classes?So far I've achieved this by adding the following css code but this doesn't feel like the "tailwind" way of doing things:
The
fill
property of the SVG that is used as the background-image needs to be adjusted. I'm sure this could be automated by generating the css above with all the text-{color} variations there are.