Skip to Content
Tokens

Overview

The tokens of Nocturne, and the rule that code uses them.

The tokens are CSS custom properties in src/styles/tokens.css. The colours have a value for each theme. The scales and the type classes are the same in both.

The tables on these pages are made from tokens.css when the site is built.

PageTokens
ColourSurfaces, hairlines, text, the accent, status, labels, code and diffs
TypeThe type classes and the font stacks
SizesSpacing, radii, controls, rows and the header
ShadowsThe overlay shadow, the focus rings and the glows

Use the tokens

Use tokens for colours, radii and font sizes. bun run lint:tokens fails on a literal colour, radius or font size in .css, .tsx and .ts files. Add lint-tokens-ignore to a line to skip it.

.my-row {
  height: var(--row-compact);
  padding: 0 var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--text-2);
}
Controls and rows at their sizesButtons 24, 28 and 32; icon buttons 24 and 28; fields 30; rows 30 compact or 36 comfortable (the panel above switches the rows). Every size is a token: --control-*, --row-*, --header.
Open the example ↗
Edit on GitHub

Last updated on

On this page