-
What version of Tailwind CSS are you using? 4.1.4 What build tool (or framework if it abstracts the build tool) are you using? postcss 8.5.3, Vite 6.0.6 What version of Node.js are you using? v22.12.0 What browser are you using? Chrome What operating system are you using? macOs Reproduction URL https://play.tailwindcss.com/BXi8aLntLb?file=css Describe your issue How to enable dark scheme with
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 16 replies
-
@layer base {
+ :root {
@variant dark {
--color-primary: blue;
}
+ }
} Conventionally, you may wish to consider adding it into the -@layer base {
+@layer theme {
:root { |
Beta Was this translation helpful? Give feedback.
When adding the
dark
class to another element other than<html>
, you need to adjust things slightly: https://play.tailwindcss.com/NfHJaa5ky4?file=css or https://play.tailwindcss.com/PbuWWCJUBV?file=css