Hoofdstijl
The main style for new projects, taken from the task board and made general. Graphite, calm and dense; colour only where it means something. Light and dark are equals. Use it when Niels chooses the Hoofdstijl for a new project.
How to use
Link the stylesheet, or copy it into the project so it can never change under you. Add class="reading" to <body> on a website for 16 px body text and bigger headings. Dark mode follows the system; force it with data-theme="dark" or "light" on <html>.
<link rel="stylesheet" href="https://design.nielskorte.nl/hoofdstijl/hoofdstijl.css">
Drop Hoofdstijl.swift into the app target. Colours switch with the system appearance. Type is the system font at Apple's text styles; spacing, radius and motion are constants.
Text("Hello").foregroundStyle(Hoofdstijl.text)
.padding(Hoofdstijl.Space.m)
.background(Hoofdstijl.surface, in: .rect(cornerRadius: Hoofdstijl.Radius.card))Principles
Colour
Read from hoofdstijl.css when this site is built. A split chip shows light (left) and dark (right). Click a swatch to copy its hex.
Back to front: page, panels and inset boxes, cards and inputs, dialogs.
Three steps. Pick the strongest one the content deserves.
Borders and the hover and pressed fill of anything clickable.
Near-black in light, near-white in dark. Primary buttons, focus, the current choice. Links are underlined because the accent is not a colour.
Only for what the colour says, each with a soft fill.
Dots, tags and chart series. Same in light and dark. Never as a fill behind text.
| Foreground on background | Light | Dark |
|---|---|---|
--text on --surface | 16.92 AAA | 14.69 AAA |
--text on --bg | 15.68 AAA | 16.00 AAA |
--muted on --surface | 5.22 AA | 6.33 AA |
--muted on --bg | 4.84 AA | 6.90 AA |
--faint on --surface | 2.70 decoration | 3.27 large text |
--accent-ink on --accent | 15.36 AAA | 15.45 AAA |
--info on --info-soft | 4.57 AA | 6.57 AA |
--ok on --ok-soft | 3.98 large text | 7.37 AAA |
--danger on --surface | 5.06 AA | 6.86 AA |
--danger on --danger-soft | 4.43 large text | 6.16 AA |
Typography
The system font: SF Pro on Apple devices, Segoe UI on Windows, Inter where installed. Monospace for ids, paths and code. Weights 400, 550 (buttons, current item), 600 and 650 (titles).
--fs-3xl · 44pxWebsite hero--fs-2xl · 32pxPage title (h1), website h2--fs-xl · 24pxSection title (h2)--fs-lg · 19pxSub-section (h3)--fs-md · 16pxWebsite body text (body.reading)--fs · 13.5pxApp body text, 13.5 px--fs-sm · 12.5pxSmall buttons, meta--fs-xs · 11pxEyebrows, column heads--monoT-58 · ~/Projects/design-system-nielskorteSpace, radius, depth
6 for small controls, 7 to 8 for buttons, inputs and cards, 10 for panels, 12 for dialogs, pill for labels.
--shadowCards, buttons. Barely there.
--shadow-lgDialogs, drawers, toasts.
Components
Class names are the same as on the task board, so code moves between projects without renaming.
One primary button per view. .btn · .primary · .ghost · .danger · .small · .large · .icon-btn
Radius 8, line border, light shadow.
On the panel colour, for grouped content.
Start a new project
Which style should it use?