lit-css-vars
Version:
For easily creating and sharing typed CSS vars for the lit.dev ecosystem.
30 lines (29 loc) • 964 B
TypeScript
/**
* Class for storing CSS property registrations. An instance is automatically constructed at
* {@link cssPropertyRegistry}.
*
* @category Internal
*/
export declare class CssPropertyRegistry {
static readonly cssPropertyDefinitionSupported: boolean;
readonly registry: Map<string, PropertyDefinition>;
constructor();
/**
* Detects if the name can be registered. Also checks if `globalThis.CSS.registerProperty` is
* supported at all.
*/
canRegisterCssProperty(name: string): boolean;
/**
* Register a property only if registration is supported and if the CSS var has not already been
* registered.
*
* @returns `true` if the definition was registered, `false` otherwise.
*/
registerProperty(definition: Readonly<PropertyDefinition>): boolean;
}
/**
* An instance of {@link CssPropertyRegistry}.
*
* @category Internal
*/
export declare const cssPropertyRegistry: CssPropertyRegistry;