element.getComputedStyles();
element.attributeStyleMap
document.styleSheets
Returns CSSStyleValue type for specified property
styleMap.get(property)
Sets property and value
styleMap.set(property, value)
Removes property
styleMap.delete(property)
Returns true if has property and false if not
styleMap.has(property)
Clears all styles
styleMap.clear()
Super class
CSSKeywordValue {value: "inline-block"}
At the time of writing return CSSStyleValue
Super class for Unit & Math
CSSUnitValue {value: 4, unit: "px"}
CSSMathSum {
operator: "sum",
values: CSSNumericArray
0: CSSUnitValue
unit: "percent"
value: 30
1: CSSUnitValue
unit: "px"
value: 20
}
CSSTransformValue {0: CSSScale, 1: CSSRotate, length: 2, is2D: true}
0: CSSScale
is2D: true
x: CSSUnitValue {value: 0.95, unit: "number"}
y: CSSUnitValue {value: 0.95, unit: "number"}
z: CSSUnitValue {value: 1, unit: "number"}
1: CSSRotate
angle: CSSUnitValue {value: 0, unit: "deg"}
is2D: true
x: CSSUnitValue {value: 0, unit: "number"}
y: CSSUnitValue {value: 0, unit: "number"}
z: CSSUnitValue {value: 1, unit: "number"}
CSSUnparsedValue {0: valueString, length: 1}
new CSSVariableReferenceValue(property, new CSSUnparsedValue([value]));
CSSStyleValue.parse(propertyString, valueString)
CSSNumericValue.parse(valueString)
CSSUnitValue.to(unit)
Only works with absolute and not relative units
The difference between the style maps: getComputedStyles, attributeStyleMap and styleSheets.
You can’t get()
a property value from attributeStyleMap for instance without it being present on the element first (by using set()
for example).
The spec is being worked on, holes are being plugged and new features in discussion.