You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So i'm upgrading my app to TW4, i have this following structure:
app.css
light.css
Initially, i was setting both as input on Vite configuration. So i though I'll just have to load Tailwindcss on app.css and reference app.css on light.css to have @apply and other stuff working. It appeared that, when i do so, any custom variant I'm adding to light.css doesn't works as a utility:
light.css
@theme {
--color-gold:var( --color-yellow-500);
}
I couldn't use text-gold on my components, however, i can create a class that @apply text-gold. It was working but means I'll have to much rewriting. So, i was thinking about importing (@import "tailwindcss") on both app.css and light.css and no longer set both as input on vite, but rather import app.css on light.css, on built, I've checked on the output if Tailwind was imported twice, it appeared that no, but I'm not sure if :
My finding is correct
Is there any way of doing what I'm intending more cleanly?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
So i'm upgrading my app to TW4, i have this following structure:
app.css
light.css
Initially, i was setting both as input on Vite configuration. So i though I'll just have to load Tailwindcss on app.css and reference app.css on light.css to have @apply and other stuff working. It appeared that, when i do so, any custom variant I'm adding to light.css doesn't works as a utility:
light.css
I couldn't use
text-gold
on my components, however, i can create a class that@apply text-gold
. It was working but means I'll have to much rewriting. So, i was thinking about importing (@import "tailwindcss") on both app.css and light.css and no longer set both as input on vite, but rather import app.css on light.css, on built, I've checked on the output if Tailwind was imported twice, it appeared that no, but I'm not sure if :thanks
Beta Was this translation helpful? Give feedback.
All reactions