New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tailwind generates inappropriate class names for custom colors #13548
Comments
Hey! So the behavior you're seeing is partially due to backwards compatability with configs from Tailwind v2. In v2, before the JIT, you could specify the negative version of a utility by prefixing the value with a In v4, none of this is an issue and the class you've written is actually possible with the following theme config: @theme {
--colors--bg-primary: #f00;
} In general in v4 negative utilities:
The fact that Tailwind v3 generates anything for the class |
Discussed in #13547
Originally posted by sxdav April 18, 2024
I'm trying to add css vars aliases to the config like that:
const config: Config = { theme: { colors: { '-bg-primary': 'var(--bg-primary)' } } }
Idea is to use them as
bg--bg-primary
, similar to css vars syntax. But tailwind generates a-bg-bg-primary
class which containsbackground-color: var(--bg-primary);
, instead ofbg--bg-primary
which does not seems like an expected behavior.The text was updated successfully, but these errors were encountered: