ImportanceNormalizer

Propagates !important from a shorthand declaration to all of its longhands.

Namespace: Com\Tecnick\Pdf\CSS

File: ImportanceNormalizer.php line 34

Propagates !important from a shorthand declaration to all of its longhands.

Tags

Methods

getAffectedLonghands()

File: ImportanceNormalizer.php line 84

public static getAffectedLonghands(string $property) : array<int, string>

Parameters

  • $property : string

Return values

array<int, string>

normalize()

File: ImportanceNormalizer.php line 121

public static normalize(string $declarations) : string

When a shorthand property has !important, all its longhands should inherit !important. This ensures consistent precedence across the cascade.

Parameters

  • $declarations : string: CSS declaration string (e.g., “color: red; border: 1px solid !important;”)

Return values

string —

Normalized CSS declaration string with !important propagated to longhands