Firefox Tomorrow

web api instance property

CSSConditionRule: conditionText property

View on MDN ↗

The read-only conditionText property of the CSSConditionRule interface returns or sets the text of the CSS rule.

Value

A string.

Examples

The following example demonstrates reading the value of conditionText on a CSSMediaRule which implements the CSSConditionRule interface.

@media (width >= 500px) {
  body {
    color: blue;
  }
}
const targetRule = document.styleSheets[0].cssRules[0];
console.log(targetRule.conditionText); // "(width >= 500px)"

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.

See also