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
Commit c63ac95
Browse filesBrowse the repository at this point in the historyBrowse files
fix(css): keep the token boundary a dropped comment stood for (#21635)
* fix(css): part two value components a comment stands between
A comment is no tree node, so `_valueComponents` saw two children with
nothing between them and made one component of them. Any transform that
rewrote the value then printed `1px 1px/*c*/1px 1px` back as
`margin:1px 1px1px`, which the engine drops. The gap the comment leaves
now parts them.
* fix(css): keep the token boundary a dropped comment stood for
A custom property's value printed its children's sources joined, which
drops a comment between two of them and fuses the tokens it parts; it
now prints the source slice, comment included. In a selector the
separator a fusing junction needs is an empty comment, not whitespace —
`a/*c*/b` is two adjacent type selectors, `a b` a descendant combinator.
* fix(css): emit a custom property's kept comment once
The value's source slice carries a kept comment along, and the writer
also had it queued to re-emit before the next top-level node — so
`--x:1px/*!c*/2px` printed it twice. The slice drops the queued copy,
which also leaves the comment where it was written.
* chore: regenerate types.d.ts for dropInserts
* fix(css): minify a custom property's comment to the boundary it stands for
A dropped comment in a custom property's value now prints as the token
boundary it stood for — a space only where the tokens would otherwise
fuse, nothing where they already part — instead of riding along in the
source slice. Kept comments stay in place.
takeInserts replaces dropInserts (one call, and it hands the printer the
text) and binary-searches in, so a rule's declarations no longer rescan
every insert queued before them.
* fix(css): minify a comment nested in a custom property's value too
A function or block in a custom property's value is no leaf, so the
comments in one are the value's too. The walk now recurses into it,
writing its delimiters back and printing each gap as the boundary it
stood for. A source holding no `/*` is written back whole, so a value
without comments costs what it did before.
* test(css): cover a bare parenthesized block in a custom property
---------
Co-authored-by: alexander-akait <[email protected]>
0 commit comments