Design system
Stratastax has one design system for every surface: the Flutter apps, this documentation site and the API
explorer. It is defined once, in stratastax.tokens.yaml
in stratastax-design, and exported for each of them.
Principles
Section titled “Principles”- Calm first. The rest and consistency of shadcn/ui: neutral surfaces, 1px borders, little shadow and compact type. The neutrals have a slight indigo tint, so they feel calm and still our own.
- A few vivid colours, used on purpose. Indigo for actions, teal for secondary actions and positive data, coral and violet as accents. Subtle colour fields carry callouts, cards and bands.
- Accessible by construction. Every text colour passes WCAG AA (4.5:1) on the backgrounds it is used on, in light and dark. The tests of stratastax-design fail otherwise, and the stx compiler warns about any app that breaks it.
- Light is the primary mode, and dark is complete as well.
Tokens
Section titled “Tokens”Each swatch shows the light and the dark value, with the contrast of the text that goes on it.
Brand
Aa
Aa
primaryAa
Aa
secondaryAa
Aa
secondaryStrongAa
Aa
accentAa
Aa
highlightfocusStatus
Aa
Aa
successAa
Aa
warningAa
Aa
dangerNeutral
Aa
Aa
backgroundAa
Aa
surfaceAa
Aa
subtleAa
Aa
mutedborderSubtle fields
Aa
Aa
primarySubtleAa
Aa
secondarySubtleAa
Aa
accentSubtleAa
Aa
highlightSubtleAa
Aa
warningSubtleAa
Aa
dangerSubtleGradient, radius and fonts
gradient.brand6px
radius.sm8px
radius.md12px
radius.lgsansInter: The quick brown fox records a matchheadingPlus Jakarta Sans: The quick brown fox records a matchmonoJetBrains Mono: The quick brown fox records a match
Rules of use
Section titled “Rules of use”| Do | Don’t |
|---|---|
Use primary for the one main action on a screen, secondary or an outline button for the others |
Use more than one coral accent or one gradient per screen |
Put text on a vivid fill in its on* colour: ink on teal and coral, white on indigo, the strong teal and danger |
Use coral for errors: an accent must never read as a failure, errors are danger |
| Use the subtle fields with ink text for callouts and bands | Put white text on fresh teal, coral or violet glow (2.5, 2.7 and 4.2:1); use the strong variants |
The type is Inter for text, Plus Jakarta Sans for headings and JetBrains Mono for code. The radius is 8px for buttons and fields, 12px for cards and round for pills, and the spacing is a multiple of 4px.
Using the tokens
Section titled “Using the tokens”| Where | How |
|---|---|
| Flutter apps | stratastax.tokens.yaml is the brand layer of the stx compiler: stx_style defaults ← the brand ← the app’s own stx.tokens.yaml |
| Web, shadcn/ui | /design/tokens.css: every token as a --stx-* property and the shadcn/ui variables |
| Starlight | /design/starlight.css, after tokens.css (this site) |
| Swagger UI | /design/swagger.css (the API explorer) |
| Design tools | /design/tokens.json, in the Design Tokens Community Group format |