Provides the ability to get and set bulk or single CSS properties to a specific CSSStyleRule.

interface RuleManager {
    get cssText(): string;
    set cssText(cssText: string): void;
    get isConnected(): boolean;
    get name(): string;
    get selector(): string;
    "[iterator]"(): Iterator<[string, string]>;
    entries(): Iterator<[string, string]>;
    get(options?: { camelCase?: boolean }): StyleProps;
    getProperty(key: string): string;
    hasProperty(key: string): boolean;
    keys(): Iterator<string>;
    removeProperties(keys: Iterable<string>): void;
    removeProperty(key: string): string;
    setProperties(
        styles: StyleProps,
        __namedParameters?: { override?: boolean },
    ): void;
    setProperty(
        key: string,
        value: string,
        options?: { override?: boolean },
    ): void;
}
Hierarchy

Accessors

  • get cssText(): string
  • Returns string

    Provides an accessor to get the cssText for the style rule or undefined if not connected.

  • set cssText(cssText: string): void
  • Parameters

    • cssText: string

      Provides an accessor to set the cssText for the style rule.

    Returns void

  • get isConnected(): boolean
  • Determines if this RuleManager is still connected / available.

    Returns boolean

    Is RuleManager connected.

  • get name(): string
  • Returns string

    Name of this RuleManager indexed by associated StyleManager.

  • get selector(): string
  • Returns string

    The associated selector for this CSS rule.

Methods

  • Returns Iterator<[string, string]>

  • Returns Iterator<[string, string]>

    Iterator of CSS property entries in hyphen-case.

  • Retrieves an object with the current CSS rule data.

    Parameters

    • Optionaloptions: { camelCase?: boolean }

      Optional settings.

      • OptionalcamelCase?: boolean

        Whether to convert property names to camel case.

    Returns StyleProps

    Current CSS style data or undefined if not connected.

  • Gets a particular CSS property value.

    Parameters

    • key: string

      CSS property key; must be in hyphen-case (IE background-color).

    Returns string

    Returns CSS property value or undefined if non-existent.

  • Returns whether this CSS rule manager has a given property key.

    Parameters

    • key: string

      CSS property key; must be in hyphen-case (IE background-color).

    Returns boolean

    Property key exists / is defined.

  • Returns Iterator<string>

    Iterator of CSS property keys in hyphen-case.

  • Removes the property keys specified. If keys is an iterable list then all property keys in the list are removed. The keys must be in hyphen-case (IE background-color).

    Parameters

    • keys: Iterable<string>

      The property keys to remove.

    Returns void

  • Removes a particular CSS property.

    Parameters

    • key: string

      CSS property key; must be in hyphen-case (IE background-color).

    Returns string

    CSS value when removed or undefined if non-existent.

  • Set CSS properties in bulk by property / value. Must use hyphen-case.

    Parameters

    • styles: StyleProps

      CSS styles object.

    • Optional__namedParameters: { override?: boolean }

    Returns void

  • Sets a particular property.

    Parameters

    • key: string

      CSS property key; must be in hyphen-case (IE background-color).

    • value: string

      CSS property value.

    • Optionaloptions: { override?: boolean }

      Options.

      • Optionaloverride?: boolean

        When true overrides any existing value; default: true.

    Returns void