jj
    Preparing search index...

    Function fetchCss

    • Fetches the contents of a CSS file as string.

      Parameters

      • url: string | URL

        The CSS file location.

      Returns Promise<string>

      The file content as a string.

      You can use import.meta.resolve('./relative-path-to.css') inside components to resolve relative paths.

      const css = await fetchCss('./style.css')
      

      If the response is not ok.