Replies: 1 comment 1 reply
-
Use regular CSS in media queries. In your case, consider having the light color scheme as the default and then have CSS to override for dark mode. You also don't want @import "tailwindcss";
@theme inline {
--font-sans: var(--font-space-grotesk);
}
@theme {
--color-background: hsl(0 0% 90%);
--color-primary: hsl(71 87% 64%);
--color-display: hsl(0 0% 8%);
--color-interface: hsl(0 0% 8%);
}
@layer theme {
@media (prefers-color-scheme: dark) {
:root {
--color-background: hsl(0 0% 10%);
--color-primary: hsl(71 87% 36%);
--color-display: hsl(0 0% 92%);
--color-interface: hsl(0 0% 8%);
}
}
} |
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
Here's how my global CSS looks like:
From my understanding, I should be able to have, for example, a
text-interface
utility class with variants for the light and dark mode, but this doesn't seem to be the case?I am not using the dark utility class directive, as this works fine on Tailwind 3 without having the need for it.
Beta Was this translation helpful? Give feedback.
All reactions