@stratakit/foundations
Version:
Foundational pieces of StrataKit
16 lines (15 loc) • 458 B
TypeScript
/**
* Adds css to the root node using `adoptedStyleSheets` in modern browsers
* and falls back to using a `<style>` element in older browsers.
*
* Pass an optional key to distinguish multiple stylesheets from each other.
*
* Returns a cleanup function to remove the styles.
*/
export declare function loadStyles(rootNode: Document | ShadowRoot, { css, key }: {
css: string;
key?: string;
}): {
loaded: boolean;
cleanup: () => void;
};