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

Don't crash when given applying a variant to a negated version of a simple utility #12514

Merged
merged 2 commits into from Dec 1, 2023

Conversation

thecrypticace
Copy link
Contributor

Given a simple utility like the following:

addUtilities({
  '.top-lg': {
    top: '6rem',
  },
})

If we encountered hover:-top-lg we didn't handle candidate elimination properly and an undefined utility snuck in causing a crash. We now handle this appropriately and emit no CSS. We still emit CSS for .top-lg when we process -top-lg by itself but that's technically a separate bug that can be addressed later.

Fixes #12435

@thecrypticace thecrypticace force-pushed the fix/negative-utility-plus-variant-crash branch from cc3d9dc to 9e48c1e Compare December 1, 2023 15:06
@thecrypticace thecrypticace changed the base branch from 3.3 to master December 1, 2023 15:07
@thecrypticace thecrypticace force-pushed the fix/negative-utility-plus-variant-crash branch from 4f50bb2 to 5e4cb47 Compare December 1, 2023 15:13
@thecrypticace thecrypticace merged commit b2b37e0 into master Dec 1, 2023
10 checks passed
@thecrypticace thecrypticace deleted the fix/negative-utility-plus-variant-crash branch December 1, 2023 15:22
thecrypticace added a commit that referenced this pull request Dec 1, 2023
…imple utility (#12514)

* Don't crash when given applying a variant to a negated version of a simple utility

* Update changelog
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

Successfully merging this pull request may close these issues.

Custom Utility Classes beginning with "-" break TailwindCSS when used in Pseudo Modifiers/Elements
1 participant