[v4] is it possible to have HEX values output for colors? #15119
-
I'm testing Tailwind CSS v4 in Maizzle, where I need to output good old-fashioned HEX colors instead of In v3 it was just a matter of disabing color opacity (and we do it in tailwindcss-preset-email), but disabling |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
@cossssmin I'm currently solving the same issue and I'm not sure if tailwind supports outputing in hex, the tedious solution I resorted to is to make a custom postcss plugin and vite plugin accordingly to patch the css and the html, I can release it as a standalone npm package if you want |
Beta Was this translation helpful? Give feedback.
-
Any reason you can't override the default color palette with a hex-based color palette? @import "tailwindcss";
@theme {
--color-*: initial;
--color-gray-50: #f9fafb;
/* ... */
} You can even just copy the v3 color palette and put it in there since the v4 color palette is just the OKLCH-ified version of those original hex colors but with a few colors adjusted to take advantage of the wider gamut (which you lose going back to hex anyways). |
Beta Was this translation helpful? Give feedback.
Any reason you can't override the default color palette with a hex-based color palette?
You can even just copy the v3 color palette and put it in there since the v4 color palette is just the OKLCH-ified version of those original hex colors but with a few colors adjusted to take advantage of the wider gamut (which you lose going back to hex anyways).