Skip to content

Ensure compound variants work with variants with multiple selectors#14016

Merged
thecrypticace merged 2 commits into
nextfrom
v4-variant-bug-fix-2
Jul 17, 2024
Merged

Ensure compound variants work with variants with multiple selectors#14016
thecrypticace merged 2 commits into
nextfrom
v4-variant-bug-fix-2

Conversation

@thecrypticace
Copy link
Copy Markdown
Contributor

Currently the not-* and has-* variants fail to generate correct CSS when given a custom variant using multiple selectors like so:

@variant hocus {
  &:hover, &:focus {
    @slot;
  }
}

Previously not-hocus:underline generated this — incorrectly including the utility inside the :not(…):

.not-hocus\\:underline:not(:hover, .not-hocus\\:underline:focus) {
  text-decoration-line: underline;
}

Now it generates the following correct CSS:

.not-hocus\\:underline:not(:hover, :focus) {
  text-decoration-line: underline;
}

This same issue applied to the has-* variant as well which now generates:

.has-hocus\\:underline:has(:hover, :focus) {
  text-decoration-line: underline;
}

@thecrypticace thecrypticace force-pushed the v4-variant-bug-fix-2 branch from eac5259 to 9ec6f5a Compare July 17, 2024 18:51
Base automatically changed from v4-variant-bug-fix-1 to next July 17, 2024 18:52
@thecrypticace thecrypticace force-pushed the v4-variant-bug-fix-2 branch from 9ec6f5a to 1a34d0a Compare July 17, 2024 18:53
@thecrypticace thecrypticace force-pushed the v4-variant-bug-fix-2 branch from 1a34d0a to 462abc9 Compare July 17, 2024 19:00
@thecrypticace thecrypticace merged commit 7052555 into next Jul 17, 2024
@thecrypticace thecrypticace deleted the v4-variant-bug-fix-2 branch July 17, 2024 19:03
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.

2 participants