CSSStyleSheet class

The interface represents a single CSS stylesheet, and lets you inspect and modify the list of rules contained in the stylesheet. It inherits properties and methods from its parent, StyleSheet.

StyleSheet

CSSStyleSheet

A stylesheet consists of a collection of CSSRule objects representing each of the rules in the stylesheet. The rules are contained in a CSSRuleList, which can be obtained from the stylesheet's cssRules property. For example, one rule might be a CSSStyleRule object containing a style such as: h1, h2 { font-size: 16pt; } Another rule might be an at-rule such as @import or @media, and so forth. See the Obtaining a StyleSheet section for the various ways a object can be obtained. A object can also be directly constructed. The constructor, and the CSSStyleSheet.replace(), and CSSStyleSheet.replaceSync() methods are newer additions to the specification, enabling Constructable Stylesheets.

Implemented types
Available extensions
Annotations
  • @JS()
  • @staticInterop

Constructors

CSSStyleSheet([CSSStyleSheetInit? options])
factory

Properties

cssRules CSSRuleList

Available on CSSStyleSheet, provided by the PropsCSSStyleSheet extension

no setter
disabled bool

Available on StyleSheet, provided by the PropsStyleSheet extension

getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
href String?

Available on StyleSheet, provided by the PropsStyleSheet extension

no setter
media MediaList

Available on StyleSheet, provided by the PropsStyleSheet extension

no setter
ownerNode → dynamic

Available on StyleSheet, provided by the PropsStyleSheet extension

no setter
ownerRule CSSRule?

Available on CSSStyleSheet, provided by the PropsCSSStyleSheet extension

no setter
parentStyleSheet CSSStyleSheet?

Available on StyleSheet, provided by the PropsStyleSheet extension

no setter
rules CSSRuleList

Available on CSSStyleSheet, provided by the PropsCSSStyleSheet extension

no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
title String?

Available on StyleSheet, provided by the PropsStyleSheet extension

no setter
type String

Available on StyleSheet, provided by the PropsStyleSheet extension

no setter

Methods

addRule([String? selector = 'undefined', String? style = 'undefined', int? index]) int

Available on CSSStyleSheet, provided by the PropsCSSStyleSheet extension

deleteRule(int index) → void

Available on CSSStyleSheet, provided by the PropsCSSStyleSheet extension

insertRule(String rule, [int? index = 0]) int

Available on CSSStyleSheet, provided by the PropsCSSStyleSheet extension

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeRule([int? index = 0]) → void

Available on CSSStyleSheet, provided by the PropsCSSStyleSheet extension

replace(String text) Future<CSSStyleSheet>

Available on CSSStyleSheet, provided by the PropsCSSStyleSheet extension

replaceSync(String text) → void

Available on CSSStyleSheet, provided by the PropsCSSStyleSheet extension

toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited