Index

Minifier

MMO\client\scs · 1 symbol · generated 30 Sep 2026

class

Minifier

Minifier.php:11

The optional optimization step of the pipeline (the spec, 49 -- step 12): duplicate selector merging and duplicate declaration removal.

class MMO\client\scs\Minifier
Namespace
MMO\client\scs
Whitespace removal is not done here: [`Emitter`](https://mmoframework.fr/documentation/mmo.client/php/scs/Emitter.md#emitter) already emits compact css when `minify` is on, which is safer than compacting generated text (a `calc(100% - 20px)` must keep the spaces around its operator).

Index

Dedupe($declarations) staticKeep only the last declaration of each property (css would do the same at runtime, for more bytes).
Merge($rules) staticMerge consecutive rules sharing the same selector and at-rule chain, and drop declarations that a later one of the same rule overrides.

Methods2

Dedupe($declarations)

staticMinifier.php:47

Keep only the last declaration of each property (css would do the same at runtime, for more bytes).

static function Dedupe(array $declarations): arrayA declaration using a css variable is never dropped: `color: red; color: var(--x)` is a deliberate fallback pattern.
$declarationsarray
returnsarray

Merge($rules)

staticMinifier.php:21

Merge consecutive rules sharing the same selector and at-rule chain, and drop declarations that a later one of the same rule overrides.

static function Merge(array $rules): arrayOnly *consecutive* rules are merged: merging distant ones would move a declaration across the rules that sit between them, and silently change the cascade.
$rulesarray
returnsarray