Table of contents
Namespace: Com\Tecnick\Pdf\CSS
File: ImportanceNormalizer.php line 34
Propagates !important from a shorthand declaration to all of its longhands.
Tags
- since: 2002-08-03
- category: Library
- author: Nicola Asuni info@tecnick.com
- copyright: 2002-2026 Nicola Asuni - Tecnick.com LTD
- license: https://www.gnu.org/copyleft/lesser.html GNU-LGPL v3 (see LICENSE)
- link: https://github.com/tecnickcom/tc-lib-pdf
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