MDN self-hosted library · e01.org

StylePropertyMap

CSS Typed Object Model API

no runnable cells web-api-interface upstream source

CSS Typed Object Model API

The StylePropertyMap interface of the CSS Typed Object Model API provides a representation of a CSS declaration block that is an alternative to CSSStyleDeclaration.

[!NOTE] This interface is only available on the window thread; unlike other interfaces in this API it cannot be accessed in Worker or Worklet contexts. Worklets receive a read-only snapshot of an element's style through StylePropertyMapReadOnly.

Instance properties

Also inherits properties from its parent interface, StylePropertyMapReadOnly.

Instance methods

Also inherits methods from its parent interface, StylePropertyMapReadOnly.

  • StylePropertyMap.append()
  • : Adds a new CSS declaration to the StylePropertyMap with the given property and value.
  • StylePropertyMap.clear()
  • : Removes all declarations in the StylePropertyMap.
  • StylePropertyMap.delete()
  • : Removes the CSS declaration with the given property.
  • StylePropertyMap.set()
  • : Changes the CSS declaration with the given property.

Specifications

Browser compatibility