CSSStyleRule

The CSSStyleRule interface represents a single CSS style rule.

MDN Reference

Properties

Link copied to clipboard
open external val cssRules: CSSRuleList

The cssRules property of the CSSGroupingRule interface returns a CSSRuleList containing a collection of CSSRule objects.

Link copied to clipboard
open external var cssText: String

The cssText property of the CSSRule interface returns the actual text of a CSSStyleSheet style-rule.

Link copied to clipboard
open external val parentRule: CSSRule?

The parentRule read-only property of the CSSRule interface returns the containing rule of the current rule if this exists, or otherwise returns null.

Link copied to clipboard
open external val parentStyleSheet: CSSStyleSheet?

The parentStyleSheet read-only property of the CSSRule interface returns the StyleSheet object in which the current rule is defined.

Link copied to clipboard
open external var selectorText: String

The selectorText property of the CSSStyleRule interface gets and sets the selectors associated with the CSSStyleRule.

Link copied to clipboard
open external val style: CSSStyleDeclaration

The read-only style property of the CSSStyleRule interface contains a CSSStyleProperties object representing the properties list in this style rule's body.

Link copied to clipboard
open external val styleMap: StylePropertyMap

The styleMap read-only property of the CSSStyleRule interface returns a StylePropertyMap object which provides access to the rule's property-value pairs.

Functions

Link copied to clipboard
open external fun deleteRule(index: Int)

The deleteRule() method of the CSSGroupingRule interface removes a CSS rule from a list of child CSS rules.

Link copied to clipboard
open external fun insertRule(rule: String, index: Int = definedExternally): Int

The insertRule() method of the CSSGroupingRule interface adds a new CSS rule to a list of CSS rules.