Markupless Documentation - v0.4.3
    Preparing search index...

    Singleton class that manages CSS injection. Hashes style objects to generate unique class names and avoids duplicate styles.

    Index

    Methods

    • Injects a style object into the DOM and returns a unique class name.

      Parameters

      Returns string

      The generated CSS class name.

      const className = StyleManager.getInstance().inject({ color: "red" });
      
    • Injects global styles (like resets or theme variables).

      Parameters

      • styles: Record<string, StyleObject>

        A map of selectors to style objects.

      Returns void

      StyleManager.getInstance().injectGlobal({
      "body": { margin: 0, padding: 0 }
      });