# CSS

# TC\ComponentLibrary\Util\Css

# parseCss

Parses a CSS string into an associative array of properties and values.

If a property has multiple definitions, its value will be overridden. In this case, values with the !important rule can only be overridden by another !important rule.

public static function parseCss(string $css, array $allowedProperties = []): array

# Arguments

Argument Type Default value Description
css string A CSS string to parse.
allowedProperties string[] [] List of allowed CSS properties.
If empty, the output array will include all properties in the passed CSS string.

# arrayToCss

Returns a CSS string with the properties and values of the passed array.

public static function arrayToCss(array $properties): string

# Arguments

Argument Type Description
properties array An associative array of properties and values.

# validateCss

public static function validateCss(string $css): bool

Validates a CSS string by parsing via Less_Parser.

# Arguments

Argument Type Description
css string A CSS string to validate.