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 eab04a5
Browse filesBrowse the repository at this point in the historyBrowse files
fix(css): join the rules a gathered @layer block leaves side by side
A named `@layer` block gathered into an earlier sibling makes the earlier
block's last rule and the incoming block's first rule neighbours, but the
streamed path folded the bodies as text and never offered that pair the
join two siblings are offered. Minifying the same sheet twice then joined
them only on the second pass: over Tailwind 4 + daisyUI 5 the printer's
own idempotence sweep reported a 75-byte drift. The collected path already
joins the seam through `_joinRuleEntries`; the streamed one now does it
with the span primitives the piece is keyed by, so both agree.
Also read an at-rule between two rules `mergeDistantRules` would join for
what its own rules declare, rather than taking it as declaring everything.
A condition only narrows which elements read the block it holds, so what
it can shadow is what its rules declare; `@layer` and anything whose
declarations cannot be read still stand in the way whatever they say.
Over the comparison fixtures that is -418 raw / -48 gzip on daisyUI, -151
raw on Foundation and -39 raw on Bulma, with nothing lost elsewhere.
Gathering two blocks of one condition is left declined with the reason
measured in place: it moves a body up into a rule merge's way, for +835
raw and +25 gzip bytes over daisyUI.
Join the rules a gathered `@layer` block leaves side by side, and read a condition between two rules `mergeDistantRules` would join for what its own rules declare.
* @property {CssEnvironment=} environment what the target can read (the CSS entries of `output.environment`), so a spelling it would not understand is never reached for; only read while printing, and an absent entry means the modern spelling is available
4120
4120
* @property {boolean=} convertLengthUnits rewrite a length into a shorter unit it is exactly equal in (`16px` -> `1pc`); off by default because it earns nothing once the asset is compressed, and only read while printing. A time is always rewritten
4121
4121
* @property {boolean=} convertApproximateColors write a polar or Lab color as the nearest hex even where that hex only approximates it: a channel too near a `.5` boundary for two engines to round it alike, and a color outside the sRGB gamut, which hex can only clip. Off by default, and only read while printing; a space engines read through transfers of their own (`a98-rgb`, `prophoto-rgb`) is left alone either way
4122
-
* @property {boolean=} mergeDistantRules give a rule the selectors of a later one printing the same block, past the rules between them; off by default, since it reorders the cascade and is sound only where nothing between declares what the block does
4122
+
* @property {boolean=} mergeDistantRules give a rule the selectors of a later one printing the same block, past the rules between them; off by default, since it reorders the cascade and is sound only where nothing between declares what the block does — a condition between counting for what its own rules declare
4123
4123
* @property {boolean=} dropOverriddenDeclarations drop a declaration a later one in the same block overrides even where nothing states that the target can read the later value; off by default, and only read while printing. With a `browserslist` selection the drop is already made wherever every browser it names is known to read the later value, so this widens the case where no target is selected — a selection naming a browser the tables do not cover still answers for the whole of it
4124
4124
* @property {boolean=} rewriteCustomProperties shorten a custom property's value the way any other value is shortened (`--x:#ffffff` -> `#fff`); off by default because `getPropertyValue()` hands that text back, and only read while printing. What it may rewrite is what any other value's tokens may be, a color in a substitution's fallback included — that being the property's value rather than the function's own argument
4125
4125
* @property {EmbeddedSourceRenderer=} renderEmbeddedSource renders source this stylesheet embeds: the payload of a `url()` `data:` URL whose media type names a language webpack knows (SVG, CSS, HTML, JSON, JavaScript). Absent, a data URL is emitted exactly as written
Copy file name to clipboardExpand all lines: schemas/WebpackOptions.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -4045,7 +4045,7 @@
4045
4045
"added": "5.111.0"
4046
4046
},
4047
4047
"mergeDistantRules": {
4048
-
"description": "Give a rule the selectors of a later one printing the same block, past the rules standing between them. Off by default because it reorders the cascade, so it holds only where nothing between the two declares a property the shared block does. A block repeated at a distance already compresses on its own, so the join is taken only where the copy of the block it drops is worth more than twice the selector it writes instead. `mergeRules` is the safe half of this, joining only what nothing stands between.",
4048
+
"description": "Give a rule the selectors of a later one printing the same block, past the rules standing between them. Off by default because it reorders the cascade, so it holds only where nothing between the two declares a property the shared block does — a condition between counts for what its own rules declare, while `@layer` and anything else whose declarations cannot be read stands in the way whatever it says. A block repeated at a distance already compresses on its own, so the join is taken only where the copy of the block it drops is worth more than twice the selector it writes instead. `mergeRules` is the safe half of this, joining only what nothing stands between.",
0 commit comments