Skip to content

v2.2.0 - #185

Merged
tbela99 merged 14 commits into
masterfrom
v.next
Nov 18, 2026
Merged

v2.2.0#185
tbela99 merged 14 commits into
masterfrom
v.next

Conversation

@tbela99

@tbela99 tbela99 commented Nov 18, 2026

Copy link
Copy Markdown
Owner

Bugs

  • minifier: the universal selector was removed before a combinator: .foo *+.x became .foo +.x, .a * .b became .a .b, *|* became |*
  • minifier: the selectors factored with :is() lost the descendant combinator: .foo .a,.foo .b became .foo:is(.a,.b) instead of .foo :is(.a,.b)
  • minifier: the declarations of a rule were moved across an @apply rule, an empty contents block was removed: @apply --mixin {}
  • minifier: the unit of the initial-value of @property was removed: initial-value: 0deg became initial-value: 0, which is not a valid <angle>
  • minifier: there is no early return in a @function: the result that precedes the conditional rules is moved after them. result: 16px; @media (...) { result: 20px } -> @media (...) { result: 20px } result: 16px
  • minifier: the conditional rules of a @function were removed when they were placed before the last result: they are never removed
  • minifier: the result descriptors of a @function were only deduplicated with {validation: true}: @function --mypi() { result: 3; result: 3.14; } -> @function --mypi(){result:3.14}
  • an empty @function or @mixin was removed with removeEmpty, and a @function with an empty result (result: ;) was dropped: they are valid definitions
  • a declaration that is not !important no longer overrides a previous !important declaration of the same property: .a{color:red !important;color:blue} -> .a{color:red!important}
  • minifier: the merge of two rules is kept only when the output is smaller (or has the same size and removes a rule). the merge of a rule into a rule that keeps some declarations repeated the selector of that rule: html{margin:0}body,div,...{margin:0;font:inherit} became html,body,div,...{margin:0}body,div,...{font:inherit}. the minified output
  • minifier: text-emphasis declarations threw Cannot read properties of undefined (reading 'includes') (text-emphasis-color has no keyword)
  • parse(), parseSync(), transform(), transformSync() and render() no longer modify the options object of the caller: a reused options object kept the source and the code units of the first input, and its validation (sync api) traversed them at every call. the sync api options check only traverses the plain objects and the arrays of blueprint.css was larger than the output of the fast mode (minify: false)

Feature

  • experimental: evaluate css mixins with {evaluateMixins: true}: the @apply rules are replaced by the mixin body, the private variables (@private, mixin arguments, custom properties of the rule) are substituted https://drafts.csswg.org/css-mixins-1/#mixin-rule
  • minification: @apply --mixin() is minified to @apply --mixin
  • the evaluated mixins and the mixins that are not referenced are replaced with a comment, they are kept with {keepMixins: true}
  • a mixin can be defined in a cascade layer or a conditional group rule that is not nested in a style rule
  • custom functions: a call that is not evaluated makes the declaration, the custom function and the mixin that contain it fail, they are not evaluated
  • custom functions that contain conditional rules (@media, @supports, @container, @when, @else) are not evaluated
  • mixins and custom functions: a definition located in a rule or an at-rule is only visible inside of it, it hides the definitions with the same name of the outer scopes. a reference that does not see a definition is not evaluated
  • mixins: @contents is replaced with a copy of the contents block of the @apply rule, or with its default contents. @result is supported
  • mixins: the value of a typed argument is computed on the element the mixin is applied to, using a registered custom property (@property) when a descendant references it
  • evaluate the custom functions with {evaluateMixins: true}: the custom function calls (--fn(1px)) are replaced by the result of the function
  • the rules that apply a mixin are not merged
  • mixins and custom functions: a value that is not valid is left as is. a mixin that is not valid is ignored and left as is
  • custom functions: a @function rule whose parameters contain the same name more than once is invalid, it is dropped when {evaluateMixins: true}. the custom functions see the custom properties of the call site. the css-wide keywords of the local variables: initial is the value of the parameter, inherit and unset the value of the calling context. the invalid declarations are not evaluated
  • shorthand properties padding-inline, padding-block, margin-inline and margin-block: .a{margin-inline-start:auto;margin-inline-end:auto} -> .a{margin-inline:auto}
  • RenderResult and TransformResult are classes. the generated css is accumulated as UTF-8 bytes in result.write (Uint8Array), result.code is a getter that decodes the bytes once, when it is first read.

Performance

  • avoid temporary strings allocation
  • faster css transform minification

Validation

  • rewrite validation to reduce execution time

@tbela99 tbela99 added this to the v2.2.0 milestone Nov 18, 2026
@tbela99 tbela99 linked an issue Nov 18, 2026 that may be closed by this pull request
30 tasks done
@tbela99
tbela99 merged commit 3418f16 into master Nov 18, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v2.2.0

2 participants