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
- Iterable<[string, string]>
- RuleManager
Index
Accessors
cssText
- 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
- cssText: string
isConnected
- get isConnected(): boolean
Determines if this RuleManager is still connected / available.
Returns boolean
Is RuleManager connected.
name
- get name(): string
Returns string
Name of this RuleManager indexed by associated StyleManager.
selector
- get selector(): string
Returns string
The associated selector for this CSS rule.
Methods
[iterator]
entries
get
- get(options?: { camelCase?: boolean }): StyleProps
Retrieves an object with the current CSS rule data.
Parameters
Optional
options: { camelCase?: boolean }Optional settings.
Optional
camelCase?: booleanWhether to convert property names to camel case.
Returns StyleProps
Current CSS style data or undefined if not connected.
getProperty
hasProperty
keys
removeProperties
removeProperty
setProperties
- setProperties(
styles: StyleProps,
__namedParameters?: { override?: boolean },
): void Set CSS properties in bulk by property / value. Must use hyphen-case.
Parameters
- styles: StyleProps
CSS styles object.
Optional
__namedParameters: { override?: boolean }
Returns void
- styles: StyleProps
setProperty
- setProperty(key: string, value: string, options?: { override?: boolean }): void
Sets a particular property.
Parameters
- key: string
CSS property key; must be in hyphen-case (IE
background-color
). - value: string
CSS property value.
Optional
options: { override?: boolean }Options.
Optional
override?: booleanWhen true overrides any existing value; default:
true
.
Returns void
- key: string
Provides the ability to
get
andset
bulk or single CSS properties to a specific CSSStyleRule.