• Fetches CSS from a remote link and creates a CSSStyleSheet out of it using createStyle.

    Parameters

    • href: string

      The link to load the CSS from

    • Optional init: RequestInit

      The request init used with fetch

    Returns Promise<CSSStyleSheet>

    A promise that resolves to a CSSStyleSheet.

    Example

    import { loadStyle } from 'deleight/css'
    const cssStyleSheet = await loadStyle('component1.css');