Guide
Preset themes
Besides the default look, the kit ships four preset themes: Material, Fluent, Paper and High contrast. Each one is a single class. Put it on <html> and every component repaints: colours, greys, corners and, for three of them, the typeface. Light and dark mode both work in every preset.
Try one
This switcher applies the preset to the whole site, so the page you are reading changes too, and your choice stays when you go to another page. The same switcher is at the top of every component page.
Your trial ends in 3 days
Pick a plan to keep your dashboards and data.
The four presets
| Preset | Class | What changes |
|---|---|---|
| Material | sv-theme-material | Tonal purple, tinted greys, Roboto, rounder corners. |
| Fluent | sv-theme-fluent | Communication blue, true greys, Segoe UI, small corners. |
| Paper | sv-theme-paper | Ink blue on cream, warm greys, a book serif, square corners. |
| High contrast | sv-theme-high-contrast | Every colour pushed apart; body text clears 7:1. |
The fonts are named, not shipped: Material asks for Roboto and Fluent for Segoe UI, and fall back to the system font where the visitor does not have them. Paper uses serif fonts every system already has.
Use one in your app
The presets are in the kit stylesheet you already import, so there is nothing to install. Add the class to the root element:
<!-- src/index.html -->
<html lang="en" class="sv-theme-fluent">
/* src/styles.css (already there from setup) */
@import "tailwindcss";
@import "@styloviz/core/styles/styloviz.css"; To switch at runtime, swap the class on document.documentElement. Use the root rather than a wrapper around your page: menus, selects and dialogs open in a layer attached to <body>, outside any wrapper, and only a class on <html> reaches them.
Contrast
Every preset is checked the same way as the default theme: the contrast check scores every text and background pair in the kit, in light and dark mode, once for each preset, and fails the build on anything below WCAG AA. High contrast goes further and keeps body text above 7:1.
Your own theme
A preset is a starting point. To use your brand colours, build a theme in the theme builder, then bring it into your app:
- Under Take it with you, choose the CSS @theme tab and press Copy, or download
styloviz-theme.css. - Paste it into
src/styles.css, after the kit stylesheet import (or after the block of kit imports thatng addwrites). A token declared later wins, so your values replace the defaults in every component. - In a downloaded template,
src/styles.cssalready has its own@themeblock: replace the matching lines there instead. - Leave the preset classes off
<html>. A preset sets the same values on that element, so it would win over your theme.
/* src/styles.css — your imports stay as they are */
@import "@styloviz/core/styles/styloviz.css";
/* styloviz-theme.css, from the theme builder */
@theme {
--color-primary-500: #7c3aed;
/* … every token the builder wrote … */
} For one part of a page, the Scoped block tab writes the same values under .tpl-yourbrand. Put that class on an element and everything inside it takes your palette. It changes values only, so keep the colour families in the global @theme.
The other tabs are for design tools and older builds: design tokens, Figma variables, SCSS and a Tailwind v3 config. The kit itself reads the CSS one. To change a theme later, paste it into Bring a theme back in on the theme builder.