Add additional color utility classes similar to tailwind #36062
Unanswered
stillhart-at-bechterew
asked this question in
Ideas
Replies: 1 comment 2 replies
-
this "class" noodle same to using unrecommended inline styles |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Introduction
I recently began using Tailwind in a new project and have been very pleased thus far. Yet, overall, I can see that I am losing a lot of speed and convenience compared to the bootstrap. One thing I noticed that I often felt missing since Bootstrap 2 was a way to customize the colors easily. I often felt constrained by the choice of only a few color groups (white, dark, success, primary, warning, and error), yet I didn't want to overwrite them. I wish I could color certain components easily while adhering to some loose form of color schema. Tailwind solved this very nicely with their utility classes.
Examples
Even further, these colors can be extended with a nice set of state modifiers:
These can also be applied to certain borders only:
A theoretical button example
This enables one to create a custom button quite easily while being somewhat harmonic in terms of colors.
Simplicity
Personally, I do not like the large numbers used and I see no reason why it shouldn't be something like "text-blue-5" instead of "text-blue-500".
Why don't you write css instead?
That is certainly possible, but I would most likely be forced to select a new set of colors each time. I do like the large but limited variety of colors given by Tailwind.
Conclusion
I am not a big fan of writing Tailwind since the difference between plain CSS and Tailwind is too minimal. Also, in Tailwind, I am forced to fix many browser quirks that are already solved with bootstrap. Yet, these color classes provided me with a very nice value-add compared to plain CSS. Therefore, I think they might be the right thing to be included in bootstrap as a new feature. There is no reason to remove the current color classes either; they could live side-by-side.
text-success
andtext-green-700
Tailwind documentation
https://tailwindcss.com/docs/background-color
https://tailwindcss.com/docs/border-color
https://tailwindcss.com/docs/text-color
Beta Was this translation helpful? Give feedback.
All reactions