You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CSS minifier drops one of two adjacent :where() rules that hold only custom properties (1.4.2 regression) #44704
Darwin 25.6.0 arm64 (also seen in a hosted build that uses 1.4.2)
What steps can reproduce the bug?
t.css:
:where(.x){--a:1}:where(.x){--b:2}
index.html:
<linkrel="stylesheet" href="./t.css"><p>x</p>
bun build ./index.html --outdir out --minify
cat out/*.css
What is the expected behavior?
Both custom properties survive, merged or not:
:where(.x){--a:1;--b:2}
This is what 1.3.11 produces (it keeps both rules), and what 1.4.2 produces for plain selectors.
What do you see instead?
:where(.x){--b:2}
--a is gone.
More cases with 1.4.2 --minify:
Input
Output
.x{--a:1}.x{--b:2}
.x{--a:1;--b:2} ✅
:root{--a:1}:root{--b:2}
:root{--a:1;--b:2} ✅
:is(.x){--a:1}:is(.x){--b:2}
.x{--a:1;--b:2} ✅
:where(.x){color:red}:where(.x){margin:0}
unchanged ✅
:where(.x){--a:1;color:red}:where(.x){--b:2}
unchanged ✅
:where(.x){--a:1}:where(.x){--b:2}
:where(.x){--b:2} ❌
:where(.x) .y{--a:1}:where(.x) .y{--b:2}
:where(.x) .y{--b:2} ❌
So it needs two adjacent rules with the same selector containing :where(), where both rules hold only custom properties. It looks as if the rules are treated as duplicates and the earlier one is dropped, without comparing the property names.
Additional information
Hit in practice when scoping a third-party stylesheet with :where(.scope): its consecutive :root{…} variable blocks became :where(.scope){…} pairs and one was lost in production builds only. Possibly related to #40364 (:where() selector lists being split).
Activity
css: add the regression test for two adjacent :where() rules with cus…
css: add merge tests for rules that keep box-orient
css: consolidate the open CSS parser fixes (oven-sh#47025)