List: {
    default: postcss.list.List;
    comma(str): string[];
    space(str): string[];
    split(string, separators, last): string[];
}

Type declaration

  • default: postcss.list.List
  • comma:function
    • Safely splits comma-separated values (such as those for transition-* and background properties).

      Once (root, { list }) {
      list.comma('black, linear-gradient(white, black)')
      //=> ['black', 'linear-gradient(white, black)']
      }

      Parameters

      • str: string

        Comma-separated values.

      Returns string[]

      Split values.

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

      Once (root, { list }) {
      list.space('1px calc(10% + 1px)') //=> ['1px', 'calc(10% + 1px)']
      }

      Parameters

      • str: string

        Space-separated values.

      Returns string[]

      Split values.

  • split:function
    • Safely splits values.

      Once (root, { list }) {
      list.split('1px calc(10% + 1px)', [' ', '\n', '\t']) //=> ['1px', 'calc(10% + 1px)']
      }

      Parameters

      • string: string

        separated values.

      • separators: string[]

        array of separators.

      • last: boolean

        boolean indicator.

      Returns string[]

      Split values.