Veylo Docs

HomeDocsThemes and tokens

Themes and tokens

Every colour in Veylo is a CSS variable set by the active theme. Change the theme and the whole kit follows, including the bevels, which are built from four tones of the face colour.

Built-in themes

NameModeCharacter
graphitedarkDefault. Charcoal face, violet accent.
midnightdarkBlue-slate face, blue accent.
classiclightGrey face, navy title bars. The original look.
lilaclightLavender face, purple accent.
paperlightNear-white, blue accent. Quiet and document-like.

Switching themes

Set data-theme on the .veylo element:

<div class="veylo" data-theme="midnight"> ... </div>

With veylo.js loaded you can also call veylo.setTheme('classic'), or add a picker that fills itself and remembers the choice in localStorage:

<select data-veylo-theme></select>

Themes are scoped, so two .veylo elements on one page can use different themes.

Tokens

VariableMeaning
--faceSurface colour of windows, buttons and cards
--fieldColour of inputs, tables and sunken areas
--deskPage background behind windows
--stripeZebra rows, quotes, notes
--code-bgCode blocks
--text, --text-dimBody text and secondary text
--link, --visitedLink colours
--ok, --no, --errSuccess, warning and error
--b1 to --b4Bevel tones, lightest highlight to darkest shadow
--ruleThin borders and dividers
--acc, --acc-a, --acc-bAccent, and the two ends of the title bar gradient
--fs, --fs-sm, --lhBase font size, small size, line height
--ui, --monoFont stacks
--measureMaximum width of .veylo (default 58rem)

Making your own theme

Override tokens on .veylo, or define a new data-theme block. Set all of --face, --field, --b1 to --b4, --rule, --text and the --acc trio so bevels and text stay readable:

.veylo[data-theme="rose"] {
  color-scheme: dark;
  --face: #3a2f33; --field: #241c1f; --desk: #2b2326; --code-bg: #171113; --stripe: #2d2427;
  --text: #f1e6e9; --text-dim: #b39ca3; --link: #ff9bb3; --visited: #d99bff;
  --ok: #7fe08f; --no: #f2b46b; --err: #ff8b8b;
  --b1: #8a7479; --b2: #55444a; --b3: #1e1518; --b4: #0a0607; --rule: #6e5a60;
  --acc-a: #66122e; --acc-b: #ef6a8d; --acc: #d6456b;
}

Dark themes should set color-scheme: dark so scrollbars and native controls match. The select arrows are drawn from --ar-u, --ar-d, --ar-l and --ar-r (inline SVG data URIs); copy them from a built-in theme of the same mode.

Caret

The text caret can be a block, bar or underscore: data-caret="block|bar|underscore|auto" on .veylo, or veylo.setCaret('bar').