How do I change Button Colors?
How do I set my button colours using the Tailwind CSS configuration? I've created a custom theme and set a new set of CSS variables for the colours I want to substitute for "primary" in tailwind using the pattern
--curiousblue-x
However, no matter how I update the new theme.css file and the tailwind.config.js file, the buttons remain the same colour.
When I look at the button in the DOM inspector it has inline styles:
I can force the colours to change by overriding --primary-x
inside my theme.css file, but this seems a little clunky since it seems to be ignoring the tailwind configuration. Is this the best I can do, or is there a cleaner way to achieve what I'm looking for.
Here's my theme.css:
My Tailwind config is attached.
This is possibly a pretty basic question since but I've been out of the PHP/HTML/CSS space for a long time (probably since about PHP v5.6) and a lot has changed!2 Replies
Solution
And if your using panels you can register colors with the $panel->colors([array of colors])