CSSHelper

Provides methods to add and manipulate CSS style rules.

Note that this class is incompatible with CSP

this.criticalRule = CSSHelper.insertRule(`#${this.id} .b-sch-event.critical {background-color:${this.criticalColor}}`);

Functions

2
findRulestatic

Looks up the first rule which matched the passed selector.

ParameterTypeDescription
selectorString | function

Either the selector string to exactly match or a function which when passed a required selector, returns true.

Returns: CSSRule -

The first matching CSS Rule object if any found.

Inserts a CSS style rule based upon the passed text

ParameterTypeDescription
cssTextString | String[]

The text of the rule including selector and rule body just as it would be specified in a CSS file.

Returns: CSSRule | CSSRule[] -

The resulting CSSRule object(s) if the add was successful.