logo dile-components dile-components

Design system

Make every component look like yours

Every component in the catalog reads its colors from the same shared set of CSS Custom Properties. Override a handful of tokens once, on your own stylesheet, and the change ripples across the whole catalog — no per-component overrides, no build step, no theming API to learn.

Shared tokens One set of CSS variables drives color across every component.
Light & dark ready Ship both themes with a single class toggle and two :root blocks.
Just CSS No compiler and no runtime theming API — override variables and you're done.

Theme Builder

Design your theme visually, skip the CSS trial and error

Not a fan of tweaking hex codes blind? The Theme Builder lets you pick a color for every shared token and see the result applied live, on real Dile components, before you write a single line of CSS.

1
Pick your colors Choose a value for each main token — primary, secondary, background, and more.
2
Preview it live Buttons, cards, inputs and other components update instantly so you can judge contrast and feel.
3
Export your CSS Download a ready-to-use theme.css file and drop it straight into your project.

Everything runs in your browser — nothing is uploaded, and your choices are saved locally so you won't lose them if you reload the page.

How to create a design theme

The most common way to create a theme is by defining your custom properties on the root element, typically with the :root selector.

You can also use the html tag selector, which is practically equivalent. The only difference is specificity, as :root has slightly higher specificity than html.
:root {
  --dile-hamburger-active-color: #000;
  --dile-primary-color: #f3f3ae;
  --dile-on-primary-color: #303030;
}

Define as many custom properties as you need to personalize your design in the :root selector. Every component ships with sensible defaults, so if you don't specify anything, it will simply look like the light theme used across this site.

Which CSS Custom Properties we use

The custom properties used across components are deliberately consistent, built on a shared set of variables. That consistency is what makes a single set of overrides ripple through the whole catalog.

Reusing these same shared variables across your own project — not just for Dile components — keeps your whole design cohesive and gives it a more professional finish.

Each component also documents its own specific CSS variables on its own documentation page. The most common theme adaptations, however, are color related — most of the shared variables across the catalog exist to define color.

You can browse the complete set of color tokens in colors.css, inside the UI package, or see them rendered with live swatches on the Colors page.

Preview them instead

Defining a light and dark theme

Use the dile-light-mode-switch component to let visitors toggle between light and dark mode.

It's essentially a switch that adds a dark-theme CSS class to the page's html tag when dark mode is active. As developers, we're responsible for defining the values our color variables should take in each mode:

:root {
  /* Light colors */
  --dile-background-color: #ffffff;
  --dile-on-background-color: #303030;
  --dile-primary-color: #f3f3ae;
  --dile-on-primary-color: #303030;
}

:root.dark-theme {
  /* Dark colors */
  --dile-background-color: #1e1e1e;
  --dile-on-background-color: #ffffff;
  --dile-primary-color: #e1e181;
  --dile-on-primary-color: #1e1e1e;
}

Ready to make it yours?

Pick your palette visually and export production-ready CSS in a couple of minutes — no design background required.