umd-styles-library
    Preparing search index...

    Variable tokens

    tokens: (
        tokens: Record<string, any>,
        options?: {
            formatKey?: (key: string, kebabCase: boolean) => string;
            important?: boolean;
            kebabCase?: boolean;
            prefix?: string;
            target?: HTMLElement;
        },
    ) => {
        apply: (obj: Record<string, any>, currentPrefix?: string) => void;
        getAppliedVariables: () => string[];
        remove: () => void;
        update: (newTokens: Record<string, any>, basePrefix?: string) => void;
    }

    Adds JSS tokens to the browser as CSS variables Uses the fromTokens function for token processing

    Type declaration

      • (
            tokens: Record<string, any>,
            options?: {
                formatKey?: (key: string, kebabCase: boolean) => string;
                important?: boolean;
                kebabCase?: boolean;
                prefix?: string;
                target?: HTMLElement;
            },
        ): {
            apply: (obj: Record<string, any>, currentPrefix?: string) => void;
            getAppliedVariables: () => string[];
            remove: () => void;
            update: (newTokens: Record<string, any>, basePrefix?: string) => void;
        }
      • Parameters

        • tokens: Record<string, any>

          JavaScript object containing design tokens

        • options: {
              formatKey?: (key: string, kebabCase: boolean) => string;
              important?: boolean;
              kebabCase?: boolean;
              prefix?: string;
              target?: HTMLElement;
          } = {}

          Configuration options

        Returns {
            apply: (obj: Record<string, any>, currentPrefix?: string) => void;
            getAppliedVariables: () => string[];
            remove: () => void;
            update: (newTokens: Record<string, any>, basePrefix?: string) => void;
        }

        Object containing apply, update, and remove methods

    1.3.0