Skip to content

StyleSheet ​

Registry of InlineStyle rules.

Diagram ​

100%Ctrl + wheel to zoom

Constructor ​

ts
new StyleSheet()

Properties ​

This class exposes no public properties.

Methods ​

.set(name: string, style: InlineStyle) ​

ArgumentTypeDescription
namestringRule name or selector.
styleInlineStyleInline style instance.

Adds or updates a rule in the stylesheet. Returns this.

.get(name: string) ​

Returns the InlineStyle for the given name, or undefined.

ArgumentTypeDescription
namestringRule name or selector.

.remove(name: string) ​

Removes a rule by name. Returns this.

ArgumentTypeDescription
namestringRule name or selector.

.generate() ​

Generates CSS text for the entire stylesheet.

.toString() ​

Exports the stylesheet as a string.

Example ​

Recommended to test it in your browser. The test here might not work properly
Console
No logs yet.