Skip to content

🐛 fix(css): keep stray text out of joined media - #1626

Merged
gaborbernat merged 1 commit into
mainfrom
fix/css-media-stray-join
Nov 5, 2026
Merged

gaborbernat merged 1 commit into
mainfrom
fix/css-media-stray-join

Conversation

@gaborbernat

@gaborbernat gaborbernat commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

minify_css was not a fixpoint on {}@media screen{, )}@media screen{b{h:-}}: the first pass gave @media screen{, )b{h:-}} and the second gave @media screen{,)b{h:-}}. #1615 did not cover it.

An @media block that ends in stray text (, ), kept verbatim as error recovery) was joined with the next same-query block, so the text became the selector of the first joined rule. Such a block now stays separate; blocks ending in a ;-terminated statement still join.

A same-query @media block following one that ends in stray text was
joined onto it, so the text became the first joined rule's selector and
a second pass changed the output. Keep such blocks apart.
@gaborbernat gaborbernat added the bug Something isn't working label Nov 5, 2026
@gaborbernat
gaborbernat enabled auto-merge (squash) November 5, 2026 00:29
@codspeed

codspeed Bot commented Nov 5, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 582 untouched benchmarks
⏩ 32 skipped benchmarks1


Comparing fix/css-media-stray-join (3e97b42) with main (7daa2f5)

Open in CodSpeed

Footnotes

  1. 32 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@gaborbernat
gaborbernat disabled auto-merge November 5, 2026 00:58
@gaborbernat
gaborbernat merged commit dbb9218 into main Nov 5, 2026
62 checks passed
@gaborbernat
gaborbernat deleted the fix/css-media-stray-join branch November 5, 2026 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant