getElementAllCssProperties function

List<String> getElementAllCssProperties(
  1. Element element
)

Returns a list of CSS properties associated with element

Implementation

List<String> getElementAllCssProperties(Element element) {
  var rules = getElementAllCssRule(element);

  var cssTexts = rules
      .map((r) => r.cssText ?? '')
      .map(parseCssRuleTextProperties)
      .where((p) => p.isNotEmpty)
      .toList();

  var elemCssText = element.style.cssText;
  if (elemCssText != null && elemCssText.isNotEmpty) {
    cssTexts.add(elemCssText);
  }

  return cssTexts;
}