How OpenGovernment UK looks, and why
One set of design tokens drives every page: colour, type, space, corners, shadow, motion and breakpoints. They are written in the open W3C Design Tokens format, so any other app can reuse them: download tokens.json or link og.css.
Principles
- Every value comes from a token. Page stylesheets may not contain raw colours, font sizes or corner radii: the build checks every page and stops if one appears.
- Teal means you can click or have chosen it. Red is for the logo and small brand marks. Colour never carries meaning alone: every nation colour is shown with its label, every status with its word.
- Text meets WCAG 2.2 AA contrast (4.5:1), and borders and focus rings meet 3:1, in both light and dark. The build checks 32 pairs in each mode.
- Anything you can tap is at least 44 pixels high.
- Two breakpoints only: phones up to 640 pixels and tablets up to 1023 pixels. On narrow screens, menus fold into a Menu button rather than scrolling off the edge.
- Fonts are served from this site. No request goes to a third party, so no visitor's address is shared.
- Motion is short (120 to 220 milliseconds) and switches off for anyone who asks for less motion.
- Old page CSS sits in a 'legacy' cascade layer, so the design system always wins without !important.
Colour
Each role has a light and a dark value. The ratio is its contrast against a card in each mode.
- bg#f3f4f1 · #0d1218Page background: crisp, faintly warm paperOn ink: 15.0:1 light, 16.1:1 dark (needs 4.5:1)
- surface#ffffff · #151b23Cards, panels, mastheadA background: the text on it is what gets checked
- surface-2#eaece7 · #1d2530Sunken areas, table stripes, tracksA background: the text on it is what gets checked
- ink#14202b · #e9eef4Body text: deep ink, not blackOn bg: 15.0:1 light, 16.1:1 dark (needs 4.5:1)
- muted#485463 · #a8b3c1Secondary textOn bg: 7.0:1 light, 8.8:1 dark (needs 4.5:1)
- line#d6dad2 · #2a3441Hairlines and card borders (decorative)A background: the text on it is what gets checked
- line-strong#7c8794 · #6b7a8cInput borders and dividers that must be seen (3:1)On bg: 3.3:1 light, 4.3:1 dark (needs 3:1)
- brand#b5301c · #ff8a72The logo and small brand accents onlyOn bg: 5.6:1 light, 8.2:1 dark (needs 4.5:1)
- brand-soft#f8e4df · #3a1c16A background: the text on it is what gets checked
- accent#0a6863 · #4fd0c4Anything you can click: links, primary buttons, selected tabsOn bg: 6.0:1 light, 10.0:1 dark (needs 4.5:1)
- accent-soft#d9efec · #0f302dA background: the text on it is what gets checked
- on-accent#ffffff · #0d1218Text on accentOn accent: 6.6:1 light, 10.0:1 dark (needs 4.5:1)
- navy#1d3a6e · #a9c1f2InformationOn bg: 10.1:1 light, 10.4:1 dark (needs 4.5:1)
- navy-soft#e1e8f5 · #1a2438A background: the text on it is what gets checked
- gold#7f5300 · #e8b95cCaution and modelled figuresOn bg: 6.1:1 light, 10.3:1 dark (needs 4.5:1)
- gold-soft#f6ead0 · #30260fA background: the text on it is what gets checked
- good#1a6634 · #7bd593Pass, done, currentOn bg: 6.4:1 light, 10.5:1 dark (needs 4.5:1)
- good-soft#dff0e4 · #12301cA background: the text on it is what gets checked
- bad#a3192a · #ff8e8cFail, withdrawn, errorOn bg: 7.0:1 light, 8.5:1 dark (needs 4.5:1)
- bad-soft#fae0e1 · #3a1619A background: the text on it is what gets checked
- focus#1a54d6 · #8fb4ffFocus ring (3:1 against every surface)On bg: 5.8:1 light, 9.1:1 dark (needs 3:1)
Nations
Checked for colour-blind readers (separation of at least 8 for every neighbouring pair) and for 3:1 contrast, in light and dark. UK-wide and Great Britain are deliberately grey: they belong to no single nation. Every nation colour is always shown with its EN, SC, WA or NI label.
- EN#a0153a · #e85d78
- SC#2b6bd6 · #4f88ea
- WA#33a061 · #2a9a6e
- NI#8f6a00 · #b58a1c
- UK#6b655c · #9a9184
- GB#a39a8c · #5c564d
Type
Atkinson Hyperlegible Next, made by the Braille Institute so letters that look alike (I, l and 1; O and 0) are easy to tell apart. IBM Plex Mono for codes such as government-organisation:D303. Both under the SIL Open Font License, served from this site. Seven sizes; the two largest grow with the screen.
- size-xsWho answers for this body?0.8125rem
- size-smWho answers for this body?0.875rem
- size-baseWho answers for this body?1rem
- size-mdWho answers for this body?1.125rem
- size-lgWho answers for this body?1.375rem
- size-xlWho answers for this body?clamp(1.5rem, 1.1rem + 1.4vw, 2rem)
- size-2xlWho answers for this body?clamp(2rem, 1.2rem + 3vw, 3rem)
Space and corners
Spacing steps on a 4 and 8 pixel grid. Three corner sizes.
- space-14px
- space-28px
- space-312px
- space-416px
- space-524px
- space-632px
- space-748px
- radius-sm · 6pxButtons, inputs, chips inside cards
- radius-md · 12pxCards and panels
- radius-pill · 999pxPills, tags, switches
Components
The same pieces on every page. Use the theme switch at the top to see them in dark mode.
| Body | Answers to | Links |
|---|---|---|
| Met Office | Ministry of Defence | 3 |
| Scottish Water | The Scottish Government | 2 |
| Ordnance Survey | Department for Science, Innovation and Technology | 2 |
Use it
- Change a value in tools/design/tokens.json, never in page CSS.
- Run python tools/design.py. It rebuilds the stylesheet and this page, and stops if any contrast pair fails.
- Rebuild the pages; python tools/design.py --audit then checks every page against the rules above. CI runs both on every change.