Skip to main content

Tokens: the Theme global

Never write colours, font sizes, radii or durations as literals: use these. The colours are written by apply! from the wallpaper.

Colours​

TokenUse
accent, on-accentprimary actions, selection; text/icons on accent
accent-softselected rows, soft highlights
backgroundwindow background
surface, surface-highgroups and cards; raised fields
text, text-dim, text-faintbody text; secondary; hints and disabled
outlinedividers, field borders
pressedthe pressed overlay
danger, on-dangerdestructive actions
scrimbehind popups and dialogs
glass-tint, glass-edge, wallpaper-dimover the wallpaper
darkwhether the scheme is dark

Type​

font is Inter. Sizes scale with the user's text size (text-scale, 1.0–1.9):

TokenBase sizeUse
caption12footers, small labels
body15rows, text
headline18group titles
title24page titles (scales half as fast)
display64the clock (scales half as fast)

Shape and spacing​

TokenValue
radius-card, radius-group, radius-input28, 20, 14 px
gap, pad, pad-page8, 16, 32 px
rowrow height, ≥ 56 px, grows with the text
touch48 px, the minimum touch target
icon24 px

Motion​

fast 120 ms, normal 240 ms, slow 380 ms; all 0 when animations is off. Motion.page is the page push.

Form factor and screen​

TokenTabTV
tvfalsetrue
safe-x, safe-y0, 064, 40 (overscan)
window-pad-x, -top, -bottom24, 32, 2464, 40, 40
focus-margin4872 (kept visible around the focused element)
focus-ink, focus-on-ink, focus-fill, focus-insetfocus visuals
lift-button, lift-icon, lift-tile, lift-card1.06, 1.1, 1.1, 1.05 (TV only)
screen-width, screen-heightthe screen
keyboard-x/y/w/hwhere the on-screen keyboard is (0 when hidden)
wallpaper, wallpaper-blurthe wallpaper images

Icons​

Icon.<name> holds Material Symbols (rounded) as images: Image { source: Icon.wifi; colorize: Theme.text; }. Available: add, alarm, arrow-back, bluetooth, calendar-month, cast, chat, check, chevron-right, close, delete, home, info, keyboard, language, lock, mic, more-vert, palette, refresh, search, settings, timer, tune, visibility, volume-up, wallpaper, warning, wifi and more: see libs/theme/slint/icons.slint. How to add one is in the repository README ("icon regeneration").