Skip to content
Discussion options

You must be logged in to vote

You could do:

@import 'tailwindcss';
@variant dark (&:where(.dark, .dark *));
@theme {
  --color-secondary: rgba(244, 173, 12, 1);
}

@layer theme {
  [class~="dark"] {
    --color-secondary: rgba(215, 156, 50, 1);
  }
}

Or

@import 'tailwindcss';
@variant dark (&:where(.dark, .dark *));
@theme {
  --color-secondary: light-dark(rgba(244, 173, 12, 1), rgba(215, 156, 50, 1));

And then use color-scheme like:

<html class="scheme-light dark:scheme-dark dark">

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by Sweet-KK
Comment options

You must be logged in to vote
1 reply
@wongjn
Comment options

wongjn Feb 6, 2025
Collaborator

Comment options

You must be logged in to vote
1 reply
@wongjn
Comment options

wongjn Feb 6, 2025
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants