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

Split :has rules when using experimental.optimizeUniversalDefaults #12736

Merged
merged 2 commits into from Jan 9, 2024

Conversation

thecrypticace
Copy link
Contributor

Given that FF only recently gained support for :has — it's necessary to split :has rules when optimizing defaults because entire rules will be invalidated rather than just the simple selector containing :has.

If you're not using experimental.optimizeUniversalDefaults you're not affected


Before:

:is(.ring-1, .has-\[\:checked\]\:ring-1:has(:checked)) {
  --tw-ring-inset: ;
  --tw-ring-offset-width: 0px;
  --tw-ring-offset-color: #fff;
  --tw-ring-color: #3b82f680;
  --tw-ring-offset-shadow: 0 0 #0000;
  --tw-ring-shadow: 0 0 #0000;
  --tw-shadow: 0 0 #0000;
  --tw-shadow-colored: 0 0 #0000;
}

After:

.ring-1 {
  --tw-ring-inset: ;
  --tw-ring-offset-width: 0px;
  --tw-ring-offset-color: #fff;
  --tw-ring-color: #3b82f680;
  --tw-ring-offset-shadow: 0 0 #0000;
  --tw-ring-shadow: 0 0 #0000;
  --tw-shadow: 0 0 #0000;
  --tw-shadow-colored: 0 0 #0000;
}
.has-\[\:checked\]\:ring-1:has(:checked) {
  --tw-ring-inset: ;
  --tw-ring-offset-width: 0px;
  --tw-ring-offset-color: #fff;
  --tw-ring-color: #3b82f680;
  --tw-ring-offset-shadow: 0 0 #0000;
  --tw-ring-shadow: 0 0 #0000;
  --tw-shadow: 0 0 #0000;
  --tw-shadow-colored: 0 0 #0000;
}

@thecrypticace thecrypticace merged commit 7b6bc50 into master Jan 9, 2024
10 checks passed
@thecrypticace thecrypticace deleted the optimize-defaults-has branch January 9, 2024 20:10
thecrypticace added a commit that referenced this pull request Jan 9, 2024
#12736)

* Split `:has` rules when using optimizeUniversalDefaults

* 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.

None yet

1 participant