list

list

Source:

Contains helpers for safely splitting lists of CSS values, preserving parentheses and quotes.

Example

const list = postcss.list;

Methods

(static) comma(string) → {Array.<string>}

Source:

Safely splits comma-separated values (such as those for transition-* and background properties).

Example
postcss.list.comma('black, linear-gradient(white, black)')
//=> ['black', 'linear-gradient(white, black)']
Parameters:
Name Type Description
string string

comma-separated values

Returns:

split values

Type
Array.<string>

(static) space(string) → {Array.<string>}

Source:

Safely splits space-separated values (such as those for background, border-radius, and other shorthand properties).

Example
postcss.list.space('1px calc(10% + 1px)') //=> ['1px', 'calc(10% + 1px)']
Parameters:
Name Type Description
string string

space-separated values

Returns:

split values

Type
Array.<string>