-
Since Tailwind uses the After digging through the Tailwind docs and source code, I don't see a clear way to override the default color generator without manually copying in all the hex or rgb values. Is there a way to do this using a custom plugin or other tooling? Current Behavior .bg-violet-900 {
--tw-background-opacity: 1;
background-color: rgb(76 29 149 / var(--tw-background-opacity));
} Desired Behavior .bg-violet-900 {
--tw-background-opacity: 1;
background-color: rgba(76, 29, 149, var(--tw-background-opacity));
} (corrected) Documentation |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
Unless it is some CSS syntax unique to Prince, I don't believe .bg-violet-900 {
--tw-background-opacity: 1;
background-color: rgba(76, 29, 149, var(--tw-background-opacity));
} Where commas separate each component, and the Regardless, if you are using some PostCSS toolchain, you could consider having a PostCSS plugin that runs after Tailwind that converts the color values to Color Level 3 compatible values. |
Beta Was this translation helpful? Give feedback.
-
Try this PostCSS plugin: https://www.npmjs.com/package/postcss-color-rgb |
Beta Was this translation helpful? Give feedback.
Yep, that's what I mean by converting them to the aforementioned format. You'd write some code to convert them and reassign them, like: