-
Notifications
You must be signed in to change notification settings - Fork 607
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add theme colors as tailwind variables #2948
Comments
It is disabled by default to not override the user's theme, you might have an |
Yes, would be nice to have an option for that without manually writing the whole variables for each color and variant (77 in total) That way, it's easy to switch a colour from the config and have it change everywhere in the app without having to replace each instance of a tailwind colour. Maybe in the config something like |
Unfortunately, we can't do that as the Also, Nuxt UI v3 has taken a CSS variable approach to avoid conflicts with the user's theme as mentioned previously, you can simply use the tokens from the color palette: We also have configurable tokens for light and dark mode, for example you can write Note that you can use the Tailwind CSS colors as usual though. I understand it can be tedious if you want to use each one of Nuxt UI colors as Tailwind CSS classes but you can make another CSS file and import it. Actually, maybe we can provide another CSS file that does that, something like |
Description
Hey!
It would be nice to have the primary/secondary/neutral/etc colours defined in
app.config.ts
directly as tailwind variables (ex: text-primary-500)Right now we have to define the colours both in
app.config.ts
andtailwind.config.js
to be able to do that. (the newmain.css
would require to create a variable for each sub-colour manually so not worth using it)For
neutral
, since it's a tailwind colour, it could be namedtext-neutr-500
Or maybe name all colours with something like
text-Uneutral-500
Additional context
No response
The text was updated successfully, but these errors were encountered: