parseCssRuleTextSelectors function

List<String> parseCssRuleTextSelectors(
  1. String? cssRuleText
)

Returns a list of selectors of the CssRule text.

Implementation

List<String> parseCssRuleTextSelectors(String? cssRuleText) {
  if (cssRuleText == null || cssRuleText.isEmpty) return [];
  var idx = cssRuleText.indexOf('{');
  if (idx < 0) return [];
  var selectorText = cssRuleText.substring(0, idx).trim();
  var list = parseStringFromInlineList(selectorText, RegExp(r'\s*,\s*'));
  return list ?? [];
}