Customize colors, radius and fonts with CSS variables.
Everything in Krz-ui is driven by CSS variables. Override them anywhere — globally or on any wrapper.
CSS variables
:root {
--krz-primary: #0ea5e9;
--krz-radius: 8px;
--krz-font: "Poppins", sans-serif;
}Brand color
--krz-primary is the only variable you need to change. The hover shade, gradient, soft tint, text and border shades, focus ring and the text drawn on top of the color are all worked out from it, in light and dark mode.
To fine-tune a single shade, set it yourself and it replaces the derived one:
:root {
--krz-primary: #0ea5e9;
--krz-primary-text: #0369a1; /* optional: your own shade for brand-colored text */
}To use a different brand color in one part of the page, set --krz-primary on a wrapper and add the krz-theme class to it, so the shades are worked out again for that section. Modals, drawers and toasts render outside the wrapper and keep the page's color.
<section className="krz-theme" style={{ "--krz-primary": "#8b5cf6" } as React.CSSProperties}>
<Button>Violet here</Button>
</section>Tokens
Dark mode
Dark mode follows the OS by default. To control it yourself, set data-theme="dark" or data-theme="light" (or the class dark / light) on <html> or any wrapper.
<html data-theme="dark">...</html>