Fix Rule#selectors losing the empty selector - #2129
Merged
Merged
Conversation
lazerg
force-pushed
the
fix/issue-2128-list-comma-empty-string
branch
from
August 6, 2026 07:54
193815f to
e57b8c7
Compare
Member
|
cc @amir-rezaei |
Member
|
Thanks. Released in 8.5.26. |
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.
8.5.25 made
list.split()return[]for an empty string (#2121), solist.comma('')went from['']to[], and with itRule#selectorson a rule whose selector is empty.Plugins read that getter and assume at least one entry.
postcss-nested'smergeSelectors()loops overparent.selectorsand joins the result back into the child, so an empty parent selector now wipes the child's:That is what the Panda CSS reproduction in #2128 hits: the selector is wiped, the block is merged away, and
.darkis gone from the tokens layer.''is a string, and itslast: truesplit has always been[''], same as the trailing item inlist.comma('a, b,'). So this narrows the guard to non-strings, which keeps what #2121 was after (list.split(undefined)no longer throws) without changing the empty-string result.Fixes #2128