Replies: 2 comments
-
Or, can we have it this way? @import "tailwindcss";
@theme(app) {
--color-gray-900: #a9a9a9;
} |
Beta Was this translation helpful? Give feedback.
0 replies
-
I need it! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
I'm a big fan of the idea to move the configuration directly into a CSS file.
Especially, I like that CSS Variables/Custom Properties have to be defined only once, and then work as Custom Props and Tailwind Classes.
I want to share an idea with you if it would be possible to set prefixes or suffices to Custom Properties.
Example: In a project design tokens are prefixed with the app name:
When initializing them with TailwindCSS
@theme
, it needs to be defined like this:Now, I'm wondering if there might be a way to allow prefixes so that the following would work as Custom Props AND TailwindCSS classes:
I created an example in the Tailwind Playground: https://play.tailwindcss.com/2Kciw6ogD0
I set pink and red colors for
gray-900
andgray-800
to make it obvious they're coming from the@theme
definition and are not preset colors.Would love to hear your thoughts! Keep up the good work!
Beta Was this translation helpful? Give feedback.
All reactions