asSassList property

SassList get asSassList

Returns a SassScript list that represents this selector.

This has the same format as a list returned by selector-parse().

Implementation

SassList get asSassList {
  return SassList(components.map((complex) {
    return SassList([
      for (var combinator in complex.leadingCombinators)
        SassString(combinator.toString(), quotes: false),
      for (var component in complex.components) ...[
        SassString(component.selector.toString(), quotes: false),
        for (var combinator in component.combinators)
          SassString(combinator.toString(), quotes: false)
      ]
    ], ListSeparator.space);
  }), ListSeparator.comma);
}