ranui
Version:
A framework-agnostic Web Components UI library built on native custom elements, with TypeScript types, light/dark theming, SSR and PWA support.
13 lines (12 loc) • 524 B
TypeScript
/**
* 将 CSS 字符串注入到指定的 Shadow DOM。
* - SSR 环境安全(自动跳过)
* - 幂等:同一 shadowRoot 不会重复注入
* - 优先使用 Constructable Stylesheets 提升性能
*/
export declare const adoptStyles: (shadowRoot: ShadowRoot, cssText: string) => void;
/**
* 注入通过组件 `sheet` 属性传入的动态样式。
* 幂等策略:同一 shadowRoot 内相同 cssText 只注入一次。
*/
export declare const adoptSheetText: (shadowRoot: ShadowRoot, cssText: string) => void;