v7.3.0

CSSHelper

A static utility class for inserting, deleting, and finding CSS style rules at runtime. It creates and manages a dedicated <style> element in the document head (or a specified parent element) and provides methods to manipulate rules within it.

Note that this class is incompatible with CSP

// Insert a rule dynamically
const rule = CSSHelper.insertRule('.b-sch-event.critical { background-color: red }');

// Later, remove it CSSHelper.deleteRule(rule);

// Find an existing rule by selector const existing = CSSHelper.findRule('.b-grid-header');

Useful functions

Function Description
insertRule Insert one or more CSS rules
findRule Find a rule by selector string or function

See also

No results

Functions

Functions are methods available for calling on the class

    Source path

    Core/helper/CSSHelper.js

    Contents