Skip to content

In Tailwind v4, how can I define a configuration variable that depends on a runtime CSS variable? #17613

Answered by wongjn
kamyarkaviani asked this question in Help
Discussion options

You must be logged in to vote

You can use @theme inline like:

@theme inline {
  --color-accent: var(--accent-9);
}

Which for bg-accent, would compile to:

.bg-accent {
  background-color: var(--accent-9);
}

Replies: 1 comment 1 reply

Comment options

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

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