CSSStyleDeclaration class Null safety

The interface represents an object that is a CSS declaration block, and exposes style information and various style-related methods and properties.

A object can be exposed using three different APIs: Via ElementCSSInlineStyle.style, which deals with the inline styles of a single element (e.g., <div style="...">). Via the CSSStyleSheet API. For example, [document.styleSheets0.cssRules0.style] returns a object on the first CSS rule in the document's first stylesheet. Via Window.getComputedStyle(), which exposes the object as a read-only interface.





cssFloat String
read / write
cssText String
read / write
hashCode int
The hash code for this object. [...]
read-only, inherited
length int
parentRule CSSRule?
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited


getPropertyPriority(String property) String
Returns the optional priority, "important". var priority = style.getPropertyPriority(property); The following JavaScript code checks whether margin is marked as important in a CSS selector rule: [...]
getPropertyValue(String property) String
Returns the property value given a property name. var value = style.getPropertyValue(property); The following JavaScript code queries the value of the margin property in a CSS selector rule: [...]
item(int index) String
Returns a CSS property name by its index, or the empty string if the index is out-of-bounds. var propertyName = style.item(index); [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
removeProperty(String property) String
Removes a property from the CSS declaration block. var oldValue = style.removeProperty(property); The following JavaScript code removes the background-color CSS property from a selector rule: [...]
setProperty(String property, String value, [String? priority = '']) Object
Modifies an existing CSS property or creates a new CSS property in the declaration block. style.setProperty(propertyName, value, priority);
toString() String
A string representation of this object. [...]


operator ==(Object other) bool
The equality operator. [...]