Skip to content

[v4] Custom variables in @theme directive not work as expected #15122

Answered by wongjn
lkwr asked this question in Help
Discussion options

You must be logged in to vote

You'd want to use the inline tag with @theme: https://play.tailwindcss.com/nSlymBjv3E?file=css

This changes the CSS rules from:

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

To:

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

Allowing your CSS variables to be resolved correctly.

Replies: 2 comments 6 replies

Comment options

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

Answer selected by lkwr
Comment options

You must be logged in to vote
5 replies
@wongjn
Comment options

wongjn Nov 23, 2024
Collaborator

@kelvin2200
Comment options

@wongjn
Comment options

wongjn Nov 23, 2024
Collaborator

@kelvin2200
Comment options

@edda
Comment options

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