Theming

Using CSS Variables and color utilities for theming.

You can choose between using CSS variables (recommended) or utility classes for theming.

CSS Variables

          
      

CSS variables are automatically configured when you use the SlateUI CLI to initialize your project.

Utility classes

          
      

Utility classes are available as an alternative to CSS variables for theming.

Convention

We use a simple background and foreground convention for colors. The background variable is used for the background color of the component and the foreground variable is used for the text color.

The background suffix is omitted when the variable is used for the background color of the component.

Given the following CSS variables:

          
      

The background color of the following component will be var(--primary) and the foreground color will be var(--primary-foreground).

          
      

List of variables

Here's the list of variables available for customization:

styles.css

          
      

Base Colors

Neutral

          
      

Stone

          
      

Zinc

          
      

Gray

          
      

Slate

          
      

Built with ❤️ by @immohammadjaved • Source code available on GitHub