fix: properly handle pseudo element ordering#3485
Merged
segunadebayo merged 1 commit intochakra-ui:mainfrom Mar 17, 2026
Merged
fix: properly handle pseudo element ordering#3485segunadebayo merged 1 commit intochakra-ui:mainfrom
segunadebayo merged 1 commit intochakra-ui:mainfrom
Conversation
🦋 Changeset detectedLatest commit: 158e21e The changes in this PR will be included in the next version bump. This PR includes changesets to release 21 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
@adbutterfield is attempting to deploy a commit to the Chakra UI Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
adbutterfield
commented
Mar 3, 2026
Contributor
Author
There was a problem hiding this comment.
Seems like the changes in this file and the one below came from a pre-commit hook.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I was just trying to update to latest version in my project and found another regression introduce in
v0.34.0.📝 Description
Fix pseudo-element conditions (
::before,::after) being placed before pseudo-class selectors in generated CSS when combined with mixed (array-based) conditions.⛳️ Current behavior (updates)
When a pseudo-element condition like
_beforeis combined with a mixed condition like_hover(defined as an array, e.g.hover: ['@media (hover: hover)', '&:is(:hover, ...)']), the generated CSS selector places the pseudo-element before the pseudo-class:.class::before:is(:hover, ...)— invalid CSSThis was introduced in 0.54.0 when
"mixed"was added to the condition type ordering array for the theme conditions fix (commit 57343c1). Mixed conditions moved from index -1 (not in array, sorted first) to index 4 (sorted after self-nesting pseudo-elements at index 1).🚀 New behavior
Pseudo-element conditions always sort last among non-at-rule conditions in the selector chain, matching the CSS spec requirement:
.class:is(:hover, ...)::before— valid CSSAdds an
isPseudoElementcheck to thesort()method that pushes::before,::after, and other pseudo-elements to the end, regardless of other condition types.💣 Is this a breaking change (Yes/No):
No
📝 Additional Information
New test case with 5 assertions covering
_before/_aftercombined with mixed, simple, and array-wrapped conditions. Full@pandacss/coretest suite passes (233/233).