getComputedStyle method

CssStyleDeclaration getComputedStyle (
  1. [String? pseudoElement]
)

The set of all CSS values applied to this element, including inherited and default values.

The computedStyle contains values that are inherited from other sources, such as parent elements or stylesheets. This differs from the style property, which contains only the values specified directly on this element.

PseudoElement can be values such as ::after, ::before, ::marker, ::line-marker.

See also:

Implementation

CssStyleDeclaration getComputedStyle([String? pseudoElement]) {
  if (pseudoElement == null) {
    pseudoElement = '';
  }
  // TODO(jacobr): last param should be null, see b/5045788
  return window._getComputedStyle(this, pseudoElement);
}

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dart.dev/stable/2.13.0/dart-html/Element/getComputedStyle.html