| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ja/docs/Web/API/StylePropertyMapReadOnly | [Back] [Original] |
Get to know MDN better
Want more browser support for this feature? Tell us why.
StylePropertyMapReadOnly CSS API CSSStyleDeclaration CSS Element.computedStyleMap()
StylePropertyMapReadOnly.sizeStylePropertyMapReadOnly
StylePropertyMapReadOnly.entries() [key, value] for...in for-in
StylePropertyMapReadOnly.forEach() StylePropertyMapReadOnly 1
StylePropertyMapReadOnly.get()StylePropertyMapReadOnly.getAll()StylePropertyMapReadOnly.has() StylePropertyMapReadOnly
StylePropertyMapReadOnly.keys()StylePropertyMapReadOnly
StylePropertyMapReadOnly.values()StylePropertyMapReadOnly
<p>
CSS
CSS
</p>
<dl id="output"></dl>
CSS
p {
--someVariable: 1.6em;
--someOtherVariable: translateX(33vw);
--anotherVariable: 42;
line-height: var(--someVariable);
}
JavaScript Element.computedStyleMap() CSS
//
const myElement = document.querySelector("p");
// <dl>
const stylesList = document.querySelector("#output");
// computedStyleMap()
const stylePropertyMap = myElement.computedStyleMap();
// <dt> <dd>
for (const [prop, val] of stylePropertyMap) {
//
const cssProperty = document.createElement("dt");
cssProperty.innerText = prop;
stylesList.appendChild(cssProperty);
//
const cssValue = document.createElement("dd");
cssValue.innerText = val;
stylesList.appendChild(cssValue);
}
| CSS Typed OM Level 1 # stylepropertymapreadonly |
StylePropertyMapReadOnlyCSS.factory_functionsCSSImageValueCSSKeywordValueCSSMathClampCSSMathInvertCSSMathMaxCSSMathMinCSSMathNegateCSSMathProductCSSMathSumCSSMathValueCSSMatrixComponentCSSNumericArrayCSSNumericValueCSSPerspectiveCSSPositionValueCSSRotateCSSScaleCSSSkewCSSSkewXCSSSkewYCSSStyleRule.styleMapCSSStyleValueCSSTransformComponentCSSTransformValueCSSTranslateCSSUnitValueCSSUnparsedValueCSSVariableReferenceValueElement.computedStyleMapHTMLElement.attributeStyleMapMathMLElement.attributeStyleMapSVGElement.attributeStyleMapStylePropertyMap| Web Proxy Viewer | New URL | Original Page |