CSSMediaRule

The CSSMediaRule interface represents a single CSS @media rule.

MDN Reference

Properties

Link copied to clipboard
open external val conditionText: String

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

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 media: MediaList

The read-only media property of the CSSMediaRule interface contains a MediaList object representing the media query list of the @media 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.

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.