mazey
    Preparing search index...

    Function loadCSS

    • Load a CSS file dynamically.

      Usage:

      import { loadCSS } from "mazey";

      loadCSS(
      "http://example.com/path/example.css",
      {
      id: "iamid", // Optional, link ID, default none
      }
      )
      .then(
      res => {
      console.log(`Load CSS Success: ${res}`);
      }
      )
      .catch(
      err => {
      console.error(`Load CSS Fail: ${err.message}`)
      }
      );

      Output:

      Load CSS Success: loaded
      

      Parameters

      • url: string

        URL of the CSS resource.

      • options: { id?: string } = ...
        • Optionalid?: string

          Optional ID for the <link> element.

      Returns Promise<string>

      A promise that resolves to "loaded" after the stylesheet loads.