Skip to content
Documentation

Foundations

Modes

Six switches change how the whole system looks: theme, density, corners, shadows, material and lines. Each one is a data attribute on the page or on any section.

How modes work

A mode is a data attribute. On <html> it sets the whole page; on any element it sets that part only, and modes nest. Components read tokens, the attribute swaps the tokens, so nothing else in your markup changes. In Figma the same switches are variable modes with the same names.

<html data-theme="dark" data-density="s" data-radius="rounded">
  …
  <section data-theme="light">a light band on a dark page</section>
AttributeValuesChanges
data-themelight, darkEvery colour. Without it, the page follows the system setting.
data-densitys, m, lControl size, padding inside containers, table rows. Touch screens default to l.
data-radiussharp, default, rounded, pillAll three corner radii.
data-elevationflat, softShadows under controls and raised surfaces. Overlays always keep theirs.
data-materialsolid, glassHeader, top bar and other chrome: opaque, or frosted with background blur.
data-lineson, minimal, noneContainer outlines and separators between rows.

Theme

Light and dark use the same palettes at different steps, so contrast holds in both. Without data-theme, the page follows the reader's system setting; set data-theme="light" to opt out. A dark band on a light page is one attribute on the section.

Light

Invoice 2026-114 is due in 14 days.

Dark

Invoice 2026-114 is due in 14 days.

The same card in light and dark
<div class="dsgn-grid" data-cols="1" data-cols-tablet="2">
  <div class="mode-panel" data-theme="light"><article class="dsgn-card"><h3 class="dsgn-card-title">Light</h3><p class="dsgn-card-text">Invoice 2026-114 is due in 14 days.</p><div class="dsgn-card-actions"><button class="dsgn-button" type="button">Pay now</button></div></article></div>
  <div class="mode-panel" data-theme="dark"><article class="dsgn-card"><h3 class="dsgn-card-title">Dark</h3><p class="dsgn-card-text">Invoice 2026-114 is due in 14 days.</p><div class="dsgn-card-actions"><button class="dsgn-button" type="button">Pay now</button></div></article></div>
</div>

Density

S suits data-heavy tools, M is the default, L suits touch and public kiosks. See Spacing and size for every value.

Corners

From square to fully round buttons. See Corner radius for the values and a live comparison.

Shadows

flat (the default) separates surfaces with borders only; soft adds a light shadow under controls and raised surfaces. Dialogs, menus and toasts always keep their shadow, because they float above the page.

Flat

Borders only.

Soft

A light shadow underneath.

Flat and soft elevation
<div class="dsgn-grid" data-cols="1" data-cols-tablet="2">
  <div class="mode-panel" data-elevation="flat"><article class="dsgn-card"><h3 class="dsgn-card-title">Flat</h3><p class="dsgn-card-text">Borders only.</p><div class="dsgn-card-actions"><button class="dsgn-button" data-variant="subtle" data-intent="neutral" type="button">Details</button></div></article></div>
  <div class="mode-panel" data-elevation="soft"><article class="dsgn-card"><h3 class="dsgn-card-title">Soft</h3><p class="dsgn-card-text">A light shadow underneath.</p><div class="dsgn-card-actions"><button class="dsgn-button" data-variant="subtle" data-intent="neutral" type="button">Details</button></div></article></div>
</div>

Material

glass makes the page chrome frosted: the header and the app top bar let the content behind show through, blurred. Where the browser has no blur, or the reader asks for less transparency, it falls back to solid. A header can also be frosted on its own with data-surface="glass", as on this site: scroll and watch the content pass under it.

Lines

on draws container outlines and separators. minimal drops the outlines around cards and alerts but keeps separators between rows. none removes both, for layouts that separate by space and surface colour alone.

On

Client
Studio Kolo
Total
CZK 24 200

Minimal

Client
Studio Kolo
Total
CZK 24 200

None

Client
Studio Kolo
Total
CZK 24 200
Lines on, minimal and none
<div class="dsgn-grid" data-cols="1" data-cols-desktop="3">
  <div class="mode-panel" data-lines="on">
    <article class="dsgn-card">
      <h3 class="dsgn-card-title">On</h3>
      <dl class="dsgn-dl"><div><dt>Client</dt><dd>Studio Kolo</dd></div><div><dt>Total</dt><dd>CZK 24 200</dd></div></dl>
    </article>
  </div>
  <div class="mode-panel" data-lines="minimal">
    <article class="dsgn-card">
      <h3 class="dsgn-card-title">Minimal</h3>
      <dl class="dsgn-dl"><div><dt>Client</dt><dd>Studio Kolo</dd></div><div><dt>Total</dt><dd>CZK 24 200</dd></div></dl>
    </article>
  </div>
  <div class="mode-panel" data-lines="none">
    <article class="dsgn-card">
      <h3 class="dsgn-card-title">None</h3>
      <dl class="dsgn-dl"><div><dt>Client</dt><dd>Studio Kolo</dd></div><div><dt>Total</dt><dd>CZK 24 200</dd></div></dl>
    </article>
  </div>
</div>