Design system

Owned by this project. Created in task T6 of feature 001 (written inside a task, not with the design-system playbook, which is not yet proven). Binding rules: profile Section 7. The values live in styles.css; a test keeps this file true (every token below exists and every token of the stylesheet is listed here).

Rules

  • Tokens only: no colour, spacing, size or duration is written outside the tokens (W3). A test scans the stylesheet.
  • Mobile first: 360 px wide is the smallest screen; one column; at 640 px and more the content stays in one column of limited width (--page-width).
  • Touch targets are at least --target-min (44 px) high and wide, for buttons, fields, rows and choices.
  • Light and dark values follow the phone’s setting. Motion is off under reduced motion (--motion-fast becomes 0s).
  • Meaning is never carried by colour alone: balances use words and a sign, notices use an icon and text, an invalid field has a thicker border and an error line.
  • The focus ring is always visible: --focus-width in --color-focus.
  • Contrast was computed on 2026-12-02 against WCAG 2.2 AA (4.5 for text, 3 for borders and icons); every pair listed passes. Automated checks (axe) run in light and dark on the specimen.

Colour tokens

Token Light Dark Use Checked pairs (light / dark)
--color-bg #f4f7f6 #0e1615 Page background text 15.38 / 15.96
--color-surface #ffffff #18231f Areas, fields, rows text 16.57 / 14.06; muted 7.32 / 8.21
--color-text #14211f #e8f1ef Text  
--color-muted #475a57 #a9bdb9 Secondary text on bg 6.79 / 9.32
--color-accent #0b6e63 #5fd3c3 Primary buttons, accent on surface 6.13 / 8.92
--color-accent-text #ffffff #06231f Text on accent 6.13 / 9.14
--color-accent-soft #e0f1ee #1d3a35 Hover of secondary controls text 14.20 / 10.69
--color-border #6a7d79 #7e948f Borders of fields, areas, rows on surface 4.35 / 5.02
--color-danger #b3261e #ffb4ab Errors on danger bg 5.72 / 9.12
--color-danger-bg #fdecea #3b1b18 Notice background  
--color-focus #0b57d0 #8ab4ff Focus ring on surface 6.39 / 7.74

Spacing, type, shape and motion tokens

Token Value Use
--space-1 0.25rem Tight gaps
--space-2 0.5rem Small gaps, button padding
--space-3 1rem Standard gap and padding
--space-4 1.5rem Between areas, dialog padding
--space-5 2rem Page padding on larger screens
--space-6 3rem Reserved for larger separations
--font-family system font stack All text (no web fonts: nothing is loaded from outside)
--text-small 0.875rem Errors, secondary text
--text-base 1rem Body text
--text-large 1.25rem Area headings
--text-title 1.75rem Page title
--line-height 1.5 Body text
--weight-strong 600 Labels, buttons, amounts
--radius 0.5rem Corners
--border-width 1px Normal borders
--focus-width 3px Focus ring, invalid field, notice and dialog borders
--focus-offset 2px Space between a control and its focus ring
--target-min 44px Smallest touch target
--page-width 40rem Width of the content column
--motion-fast 150ms (0s under reduced motion) Colour changes of controls
--pixel 1px Hidden helper text (screen readers only)

Components (design Section 4)

Component Classes Notes
Text field with label and error line .field, .field__label, .field__input, .field__error Label always visible; the error is linked with aria-describedby; invalid field has aria-invalid="true" and a thicker border
Primary / secondary button .button, .button--primary, .button--secondary Primary uses the accent; one primary per area
List row .row, .row__main, .row__amount Static row (person, balance)
List row that opens something .row--action (a button) Whole expense row is one target
Choice list .choices, .choices__legend, .choice A fieldset with a legend; each choice is a label of at least 44 px
Notice .notice, .notice__icon Icon and text, not colour only
Full-screen panel .panel, .panel__form, .panel__bar, .panel__title, .panel__body, .panel__footer A native dialog: full screen at 360 px, a centred box of --page-width from 640 px; “Cancel” and the title on top, “Save” at the bottom; the browser traps focus and returns it
Dialog box .dialog, .dialog__buttons Question first; the safe button comes first in reading order
Counter text .muted Plain text such as “3 di 12”
Balance sign .balance__sign ”+” or “−” before the words “is owed” / “owes”
Helper .visually-hidden, .area, .page Hidden text for screen readers; area box; page column

Specimen

design-system-preview.html shows every component in light and dark, for review and for the automated checks. It is a development file: it is not part of the product and is not published.


Back to top

NodFirst is released under the MIT licence. These pages are generated from the files in the repository.

This site uses Just the Docs, a documentation theme for Jekyll.