Firefox Tomorrow

web api instance property

CSSValue: cssText property

View on MDN ↗

The cssText property of the CSSValue interface represents the current computed CSS property value.

[!NOTE] This property was part of an attempt to create a typed CSS Object Model. This attempt has been abandoned, and most browsers do not implement it.

To achieve your purpose, you can use:

Value

A string representing the current CSS property value.

Examples

const styleDeclaration = document.styleSheets[0].cssRules[0].style;
const cssValue = styleDeclaration.getPropertyCSSValue("color");
console.log(cssValue.cssText);

Specifications

This feature was originally defined in the DOM Style Level 2 specification, but has been dropped from any standardization effort since then.

It has been superseded by a modern, but incompatible, CSS Typed Object Model API that is now on the standard track.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.

See also