Skip to content

ImmutableCssRuleNode ​

Interface for immutable CSS rule nodes in stylesheets.

typescript
interface ImmutableCssRuleNode extends BaseImmutableCssNode

Description ​

ImmutableCssRuleNode represents CSS rules with selectors in the stylesheet. It provides methods to access rule properties, selectors, and child nodes (properties and comments). This interface is essential for inspecting and analyzing CSS rules before modification.

Import ​

typescript
import { ImmutableCssRuleNode } from '@stripoinc/ui-editor-extensions';

Inheritance ​

Extends: BaseImmutableCssNode

Methods ​

getSelector() ​

Retrieves the selector string of the CSS rule.

typescript
getSelector(): string

Returns: string - The CSS selector

Throws: Error if the node cannot be found

Example:

typescript
const selector = rule.getSelector();
// ".button", "#header", "table.email-container", etc.