Class StyleParse
Index
Constructors
Methods
Constructors
constructor
- new StyleParse(): StyleParse
Returns StyleParse
Methods
Static
cssText
- cssText(
cssText: string,
options?: { camelCase?: boolean },
): { [key: string]: string } Parse an inline CSS style text string into an object.
Parameters
- cssText: string
Inline CSS style text to parse.
Optional
options: { camelCase?: boolean }Optional settings.
Optional
camelCase?: booleanWhether to convert property names to camelCase.
Returns { [key: string]: string }
Parsed object of CSS properties.
- cssText: string
Static
pixels
Static
remPixels
- remPixels(multiplier?: number, options?: { targetDocument?: Document }): number
Returns the pixel value for
1rem
based on the root document element. You may apply an optional multiplier.Parameters
Returns number
The pixel value for
1rem
with or without a multiplier based on the root document element.
Provides resources for parsing style strings.