Skip to content
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

cssnano removes empty custom properties #7801

Closed
jonnitto opened this issue Mar 9, 2022 · 3 comments
Closed

cssnano removes empty custom properties #7801

jonnitto opened this issue Mar 9, 2022 · 3 comments

Comments

@jonnitto
Copy link

jonnitto commented Mar 9, 2022

I opened also a bug report on the cssnano repo: cssnano/cssnano#1350

Describe the bug

In TailwindCSS, many custom properties are set, like --tw-grayscale: ; A class like .blur sets following CSS:

.blur {
  --tw-blur: blur(8px);
  filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
}

The problem is, if the class .grayscale is not used (who set a value, just like blur) the custom property gets removed and the class blur doesn't work anymore.

@epuluikis
Copy link

Same issue happens with the backdrop. 'Dummy' classes aren't being generated and as a result, backdrop doesn't work.

@jonnitto
Copy link
Author

jonnitto commented Mar 10, 2022

The bug is fixed, I'll close this issue as soon as the new version of cssnano is relased

@adamwathan
Copy link
Member

Going to close since this is a cssnano bug and not a Tailwind bug 👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants