ranui
Version:
A framework-agnostic Web Components UI library built on native custom elements, with TypeScript types, light/dark theming, SSR and PWA support.
17 lines (16 loc) • 1.11 kB
TypeScript
/**
* Honour the user's "reduce motion" OS setting in every component. Adopted into
* each shadow root (last, so it overrides the component's own transitions), and
* scoped to the shadow tree by `*`. Only active when the user has the preference set.
*/
export declare const REDUCED_MOTION_CSS: string;
export declare const ensureShadowRoot: (host: HTMLElement, cssText?: string, options?: ShadowRootInit) => ShadowRoot;
export declare const ensureShadowElement: <T extends HTMLElement>(root: ShadowRoot, selector: string, factory: () => T) => T;
export declare const getStringAttribute: (element: HTMLElement, name: string, fallback?: string) => string;
export declare const setStringAttribute: (element: HTMLElement, name: string, value: string | null | undefined, options?: {
removeEmpty?: boolean;
}) => void;
export declare const setBooleanAttribute: (element: HTMLElement, name: string, value: boolean, options?: {
aria?: string;
}) => void;
export declare const syncSheetAttribute: (host: HTMLElement, root: ShadowRoot, name: string, oldValue: string | null, newValue: string | null) => void;