C15T Logo

Styling with CSS Variables

Learn how to use CSS variables to create flexible and dynamic themes for c15t components.

CSS Variables are our recommended way to style your components. They provide a powerful way to create dynamic, maintainable themes for components. This approach is particularly useful for dark mode, theming, and responsive design.

Basic Usage

Each component has a set of predefined CSS variables that you can override:

<CookieBanner
  theme={{
    'banner.card': {
      style: {
        '--banner-background-color': 'red',
        '--banner-border-radius': '0px',
      },
    },
  }}
/>

All CSS Variables

ComponentCSS Variables
Cookie BannerOpen in GitHub
Consent Manager DialogOpen in GitHub
Consent Manager WidgetOpen in GitHub
ButtonOpen in GitHub
AccordionOpen in GitHub
SwitchOpen in GitHub