selectCssRuleWithSelector function

List<CssRule> selectCssRuleWithSelector(
  1. Pattern targetSelector
)

Returns a list of CssRule with targetSelector patterns.

Implementation

List<CssRule> selectCssRuleWithSelector(Pattern targetSelector) {
  var sheets = getAllCssStyleSheet();

  var rules = sheets
      .map((s) => getAllCssRuleBySelector(targetSelector, s))
      .expand((e) => e)
      .toList();

  return rules;
}