CDP Frontend SDK
    Preparing search index...

    Function themeToCssVariables

    • Converts a theme object to a CSS variables object for the CDP web component library.

      Parameters

      • theme: Record<string, string>

        The theme object to convert.

      Returns CDPWebCSSVariables

      A CSS variables object.

      const themeOverrides: Partial<Theme> = {
      "color-bg-primary": "red",
      };

      // { "--cdp-web-color-bg-primary": "red" }
      const cssVariables = themeToCssVariables(themeOverrides