CSSStyleSheet

open class CSSStyleSheet(options: CSSStyleSheetInit = definedExternally) : StyleSheet(source)

The CSSStyleSheet interface represents a single CSS stylesheet, and lets you inspect and modify the list of rules contained in the stylesheet.

MDN Reference

Constructors

Link copied to clipboard
constructor(options: CSSStyleSheetInit = definedExternally)

Properties

Link copied to clipboard

The read-only CSSStyleSheet property cssRules returns a live CSSRuleList which provides a real-time, up-to-date list of every CSS rule which comprises the stylesheet.

Link copied to clipboard

The disabled property of the applying to the document.

Link copied to clipboard
val href: String?

The href property of the StyleSheet interface returns the location of the style sheet.

Link copied to clipboard

The media property of the StyleSheet interface specifies the intended destination media for style information.

Link copied to clipboard

The ownerNode property of the with the document.

Link copied to clipboard

The read-only CSSStyleSheet property ownerRule returns the CSSImportRule corresponding to the @import at-rule which imported the stylesheet into the document.

Link copied to clipboard

The parentStyleSheet property of the the given style sheet.

Link copied to clipboard

The title property of the StyleSheet interface returns the advisory title of the current style sheet.

Link copied to clipboard

The type property of the StyleSheet interface specifies the style sheet language for the given style sheet.

Functions

Link copied to clipboard
fun deleteRule(index: Int)

The CSSStyleSheet method deleteRule() removes a rule from the stylesheet object.

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

The CSSStyleSheet.insertRule() method inserts a new CSS rule into the current style sheet.

Link copied to clipboard
suspend fun replace(text: String): CSSStyleSheet

The replace() method of the CSSStyleSheet interface asynchronously replaces the content of the stylesheet with the content passed into it.

Link copied to clipboard
Link copied to clipboard
fun replaceSync(text: String)

The replaceSync() method of the CSSStyleSheet interface synchronously replaces the content of the stylesheet with the content passed into it.