Replaced colors with config colors#64
Conversation
|
This is a very much needed PR, thank you very much @danhab99 🙇♂️ @estevanmaito could you please have a look? It's necessary to have an abstraction of the colors instead of using the color names directly. The current customization solution is not solid enough: For example if I want just change the color of the primary button (or my accent color in general), I'll have to rewrite all the styles of the button (like border radius...), and I find this to be not efficient at all, in one project I had to rewrite almost the whole theme. Just a few remarks regarding the PR, @danhab99:
One alternative solution (mainly to @estevanmaito) would be to merge the Tailwind classes as well in the wrapper, we can use tailwind-merge. This way at least we don't have to write all the rules/styles in our theme just to overwrite the color. |
I found it kind of weird that components came with default colors that require you to edit the theme itself. Tailwindcss provides a system for creating a color pallet and I think windmill should take advantage of that. I've taken the liberty of replacing every single color in the default theme with a discriptivly named color to be later resolved in
tailwind.config.js.Here's my proposal:
wm-primarywm-successwm-dangerwm-neutralwm-warningwm-infowm-darkTextwm-darkWarningThis would require users to create a
tailwind.config.jsresembling something like this:Ofcourse I'm open to suggestions and opinions. Thoughts?