Get to know MDN better
This feature is not Baseline because it does not work in some of the most widely-used browsers.
The StylePropertyMapReadOnly interface of the CSS Typed Object Model API provides a read-only representation of a CSS declaration block that is an alternative to CSSStyleDeclaration. Retrieve an instance of this interface using Element.computedStyleMap().
Returns an unsigned long integer containing the size of the StylePropertyMapReadOnly object.
Returns an array of a given object's own enumerable property [key, value] pairs, in the same order as that provided by a for...in loop (the difference being that a for-in loop enumerates properties in the prototype chain as well).
StylePropertyMapReadOnly.forEach()Executes a provided function once for each element of StylePropertyMapReadOnly.
StylePropertyMapReadOnly.get()Returns the value of the specified property.
StylePropertyMapReadOnly.getAll()Returns an array of CSSStyleValue objects containing the values for the provided property.
StylePropertyMapReadOnly.has()Indicates whether the specified property is in the StylePropertyMapReadOnly object.
StylePropertyMapReadOnly.keys()Returns a new array iterator containing the keys for each item in StylePropertyMapReadOnly.
StylePropertyMapReadOnly.values()Returns a new array iterator containing the values for each index in the StylePropertyMapReadOnly object.
We have to have an element to observe:
We add a touch of CSS with a custom property to better demonstrate the output:
We add JavaScript to grab our paragraph and return back a definition list of all the default CSS property values using Element.computedStyleMap().
| CSS Typed OM Level 1 # stylepropertymapreadonly |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Aug 5, 2025 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.