Foundations
The colours, text, spacing, layout, sizes, motion and icons that every GGDS component uses. They are called design tokens: named values such as --ggds-color-link, so a website never has to repeat a colour code.
Colour
GGDS uses one government blue for links, buttons and focus on every website. Each institution adds its own colour only on its theme parts: the line under the header, its name, the homepage hero, the footer and its card in a list.
The red, gold and green are the flag colours. They appear only as thin lines and bands, and as gold text on dark backgrounds. Their exact values will be updated when an official specification is published.
Can people read it?
Contrast is how much a colour stands out from what is behind it, written as a ratio: 1 to 1 is invisible, 21 to 1 is black on white. People with low vision, old screens or bright sunlight need enough of it.
- Text needs at least 4.5 to 1 (WCAG 2.2 level AA).
- Borders of form fields and the focus outline need at least 3 to 1, so people can see where to type and where they are.
- White text on the hero and footer needs 7 to 1, because it carries your institution’s colour on every page.
These are all the colour combinations GGDS uses, measured when this page was built. If a change made any of them too faint, the build would stop.
Text
-
Body text on the page
Easy to read: 16.0 to 1 (needs 4.5 to 1)
--ggds-color-texton--ggds-color-surface -
Body text on a grey panel
Easy to read: 14.9 to 1 (needs 4.5 to 1)
--ggds-color-texton--ggds-color-surface-sunken -
Hints and secondary text on the page
Easy to read: 7.5 to 1 (needs 4.5 to 1)
--ggds-color-text-mutedon--ggds-color-surface -
Hints and secondary text on a grey panel
Easy to read: 7.0 to 1 (needs 4.5 to 1)
--ggds-color-text-mutedon--ggds-color-surface-sunken -
Secondary text on a light blue panel
Easy to read: 7.0 to 1 (needs 4.5 to 1)
--ggds-color-text-mutedon--ggds-color-brand-50 -
Body text on a selected item
Easy to read: 13.5 to 1 (needs 4.5 to 1)
--ggds-color-texton--ggds-color-brand-100
Links
-
A link on the page
Easy to read: 6.9 to 1 (needs 4.5 to 1)
--ggds-color-linkon--ggds-color-surface -
A link on a grey panel
Easy to read: 6.5 to 1 (needs 4.5 to 1)
--ggds-color-linkon--ggds-color-surface-sunken -
A link under the pointer
Easy to read: 13.3 to 1 (needs 4.5 to 1)
--ggds-color-link-hoveron--ggds-color-surface -
A link already visited
Easy to read: 9.9 to 1 (needs 4.5 to 1)
--ggds-color-link-visitedon--ggds-color-surface -
White text on a main button
Easy to read: 6.9 to 1 (needs 4.5 to 1)
--ggds-color-text-inverseon--ggds-color-brand-700
Your institution’s colours
-
White text on the hero and footer
Very easy to read: 7.1 to 1 (needs 7 to 1)
--ggds-color-text-inverseon--ggds-color-institution-deep -
The gold purpose line on the hero
Easy to read: 4.8 to 1 (needs 4.5 to 1)
--ggds-color-flag-goldon--ggds-color-institution-deep -
Your institution’s name in the header
Easy to read: 6.9 to 1 (needs 4.5 to 1)
--ggds-color-institutionon--ggds-color-surface
Forms and focus
-
The border of a form field
Easy to see: 5.5 to 1 (needs 3 to 1)
--ggds-color-border-controlon--ggds-color-surface -
The border of a form field on a grey panel
Easy to see: 5.1 to 1 (needs 3 to 1)
--ggds-color-border-controlon--ggds-color-surface-sunken -
The focus outline against its glow
Easy to see: 11.9 to 1 (needs 3 to 1)
--ggds-color-focus-ringon--ggds-color-focus-halo -
The focus glow on the page
Easy to see: 19.6 to 1 (needs 3 to 1)
--ggds-color-focus-haloon--ggds-color-surface
Messages
-
A success message
Easy to read: 5.9 to 1 (needs 4.5 to 1)
--ggds-color-status-success-strongon--ggds-color-status-success-subtle -
White text on a confirmation panel
Easy to read: 6.6 to 1 (needs 4.5 to 1)
--ggds-color-text-inverseon--ggds-color-status-success-strong -
A warning message
Easy to read: 6.9 to 1 (needs 4.5 to 1)
--ggds-color-status-warning-strongon--ggds-color-status-warning-subtle -
A danger message
Easy to read: 5.7 to 1 (needs 4.5 to 1)
--ggds-color-status-danger-strongon--ggds-color-status-danger-subtle -
An error message under a form field
Easy to read: 6.5 to 1 (needs 4.5 to 1)
--ggds-color-status-danger-strongon--ggds-color-surface -
An information message
Easy to read: 6.9 to 1 (needs 4.5 to 1)
--ggds-color-status-info-strongon--ggds-color-status-info-subtle -
A neutral tag
Easy to read: 6.6 to 1 (needs 4.5 to 1)
--ggds-color-status-neutral-strongon--ggds-color-status-neutral-subtle
All colours
| Swatch | Token | Value | Use |
|---|---|---|---|
--ggds-color-brand-50 | #f0f8fc | ||
--ggds-color-brand-100 | #dceff9 | ||
--ggds-color-brand-500 | #0090d8 | Light blue. 3.5:1 on white: decoration and large text only, never body text or control borders | |
--ggds-color-brand-600 | #0073ad | 5.2:1 on white | |
--ggds-color-brand-700 | #005f8f | Links and main buttons (6.9:1 on white) | |
--ggds-color-brand-800 | #00496e | Card titles and strong accents (9.6:1 on white) | |
--ggds-color-brand-900 | #00334d | Deep surfaces; link hover (13.3:1 on white) | |
--ggds-color-institution | #005f8f | The default theme colour (6.9:1 on white) | |
--ggds-color-institution-deep | #005d8c | Darker shade of the default theme, for the hero and footer (7.1:1 under white text) | |
--ggds-color-flag-red | #ce1126 | ||
--ggds-color-flag-gold | #fcd116 | ||
--ggds-color-flag-green | #006b3f | ||
--ggds-color-flag-black | #000000 | ||
--ggds-color-text | #14213d | ||
--ggds-color-text-muted | #4a5568 | ||
--ggds-color-text-inverse | #ffffff | ||
--ggds-color-link | #005f8f | ||
--ggds-color-link-hover | #00334d | ||
--ggds-color-link-visited | #5b2a86 | NITA S&A Standard 6.4.14: read links marked by a standard colour convention | |
--ggds-color-border-subtle | #d5dbe5 | Decoration only. Never the only boundary of a control. | |
--ggds-color-border-strong | #9aa5b8 | Decoration only (2.5:1). Never the only boundary of a control. | |
--ggds-color-border-control | #5c6a80 | Form control boundaries; at least 3:1 on every surface (WCAG 1.4.11) | |
--ggds-color-surface | #ffffff | ||
--ggds-color-surface-sunken | #f5f7fa | ||
--ggds-color-surface-raised | #ffffff | ||
--ggds-color-status-success-strong | #0d6b3a | ||
--ggds-color-status-success-subtle | #e8f5ee | ||
--ggds-color-status-warning-strong | #7a4b00 | ||
--ggds-color-status-warning-subtle | #fff6e0 | ||
--ggds-color-status-danger-strong | #b3261e | ||
--ggds-color-status-danger-subtle | #fdecea | ||
--ggds-color-status-info-strong | #0b5394 | ||
--ggds-color-status-info-subtle | #e8f1fb | ||
--ggds-color-status-neutral-strong | #4a5568 | ||
--ggds-color-status-neutral-subtle | #eef1f5 | ||
--ggds-color-focus-ring | #ffbf47 | ||
--ggds-color-focus-halo | #0b0c0c |
Text
GGDS uses the fonts already on each phone and computer, so nothing extra downloads on slow or costly connections.
Font size 3xl: Apply for a licence
Font size 2xl: Apply for a licence
Font size xl: Apply for a licence
Font size lg: Apply for a licence
Font size base: Apply for a licence
Font size sm: Apply for a licence
Font size xs: Apply for a licence
- Body text is 17px (
--ggds-font-size-base), larger than most websites, because many people read on small phones in bright light. Do not set body text smaller. - The two largest sizes grow with the screen, so headings fit a 320px phone without breaking words.
- Use two weights only: regular for text, bold for headings and emphasis. Lines of text are at most 68 characters wide (
--ggds-measure, the classggds-measure). - Sizes are in
rem, so they follow the text size people choose on their device.
| Token | Value | Use |
|---|---|---|
--ggds-font-family-sans | system-ui,-apple-system,Segoe UI,Roboto,Noto Sans,Ubuntu,Cantarell,Helvetica Neue,Arial,sans-serif | The fonts already on each device, so nothing extra downloads. |
--ggds-font-family-mono | ui-monospace,SF Mono,Cascadia Mono,Roboto Mono,Menlo,monospace | |
--ggds-font-size-xs | 0.8125rem | |
--ggds-font-size-sm | 0.9375rem | |
--ggds-font-size-base | 1.0625rem | 17px reading size |
--ggds-font-size-lg | 1.25rem | |
--ggds-font-size-xl | 1.5rem | |
--ggds-font-size-2xl | clamp(1.75rem, 1.4rem + 1.4vw, 2.25rem) | |
--ggds-font-size-3xl | clamp(2rem, 1.5rem + 2.2vw, 3rem) | |
--ggds-font-weight-regular | 400 | |
--ggds-font-weight-bold | 700 | |
--ggds-line-height-tight | 1.2 | |
--ggds-line-height-body | 1.6 | |
--ggds-measure | 68ch |
Spacing
One spacing scale for padding, margins and gaps, in steps of 4px. Use the scale, not values in between, so pages line up and keep the same rhythm on every government website.
- Use small steps (1 to 3) inside a component, 4 and 6 between related things, and 8 and above between sections.
- Leave more space above a heading than below it, so it belongs to what follows.
| Sample | Token | Value | Use |
|---|---|---|---|
--ggds-space-1 | 0.25rem | ||
--ggds-space-2 | 0.5rem | ||
--ggds-space-3 | 0.75rem | ||
--ggds-space-4 | 1rem | ||
--ggds-space-6 | 1.5rem | ||
--ggds-space-8 | 2rem | ||
--ggds-space-12 | 3rem | ||
--ggds-space-16 | 4rem |
Layout
Pages are one column on phones, and gain columns only as the screen allows. Design for a 320px phone first.
ggds-containercentres the page, up to 76rem wide, with a side margin (the gutter) that grows from 16px on phones to 32px on large screens, and keeps clear of a phone's notch.ggds-maingives the main content its space above and below. Put it on<main id="main" tabindex="-1">, the skip link's target.- Use the three breakpoints only. Components change layout at them, and the tests reject any other width in GGDS's CSS.
- To arrange your own content, use the layout classes: stacks, rows that wrap, grids and a side column, spaced with this scale. They need no CSS framework.
| Token | Value | Use |
|---|---|---|
--ggds-size-gutter | clamp(1rem, 0.6rem + 2vw, 2rem) | |
--ggds-size-content-max | 76rem | |
--ggds-breakpoint-tablet | 48rem | |
--ggds-breakpoint-desktop | 64rem | |
--ggds-breakpoint-wide | 80rem | From this width the header shows its sections in one row beside the name. |
--ggds-breakpoint-tall | 36rem | A height, not a width: from this height a pinned scroll scene stays on screen. Below it (a short screen or high zoom) the scene is an ordinary section, so nothing is cut off. |
Sizes and touch targets
Everything people tap is at least 44px tall: buttons, links in menus, form fields, radios and checkboxes with their labels. That is more than WCAG 2.2 asks (24px), because many people use phones with one hand, on the move.
| Token | Value | Use |
|---|---|---|
--ggds-size-target | 44px | Minimum touch target (exceeds WCAG 2.5.8 AA, 24px) |
--ggds-size-icon-sm | 1rem | |
--ggds-size-icon-md | 1.25rem | |
--ggds-size-icon-lg | 1.5rem | |
--ggds-size-icon-xl | 2rem |
Focus
When people use a keyboard, the element they are on has a 3px gold ring with a dark band around it, so it shows on light and dark backgrounds alike. Never remove it. In Windows contrast themes it uses the system's highlight colour.
Corners and shadows
Small rounded corners, and light shadows only where something sits above the page. Shadows never carry meaning: anything that must be seen also has a border.
| Sample | Token | Value | Use |
|---|---|---|---|
--ggds-radius-sm | 4px | ||
--ggds-radius-md | 8px | ||
--ggds-radius-lg | 14px | ||
--ggds-radius-pill | 999px | ||
--ggds-radius-round | 50% | ||
--ggds-radius-sheet | 18px | Top corners of a bottom sheet on phones. |
| Sample | Token | Value | Use |
|---|---|---|---|
--ggds-shadow-1 | 0 1px 2px rgb(20 33 61 / 0.08), 0 1px 3px rgb(20 33 61 / 0.06) | ||
--ggds-shadow-2 | 0 4px 12px rgb(20 33 61 / 0.1), 0 2px 4px rgb(20 33 61 / 0.06) | ||
--ggds-shadow-sheet | 0 -8px 32px rgb(20 33 61 / 0.18) | A bottom sheet over the page on phones. |
Motion
Movement is short and explains a change, such as a menu opening. Nothing flashes. The only thing that moves on its own is the optional hero drawing, only for people who have not asked for less motion, and it stops within 5 seconds.
- Animate only inside
@media (prefers-reduced-motion: no-preference), so people who ask their device for less motion get none. - Use the duration and easing tokens, so movement feels the same everywhere.
- Never make people wait for an animation before they can act.
- Anything that moves on its own must stop within 5 seconds, or have a pause button (WCAG 2.2.2). A finite
animation-iteration-countdoes it without JavaScript; never useinfinite. - Movement can also follow the scroll: parts that rise into view, layers with depth, lines that draw themselves and scenes that tell a story, with the scroll effects. They follow the person's own scrolling, never take it over, and leave the page still and finished for anyone who asks for less motion.
- Keep scroll effects to homepages, campaign and information pages. Never inside a service's steps: questions, check your answers, errors, payment and confirmation stay still.
| Token | Value | Use |
|---|---|---|
--ggds-motion-duration-fast | 120ms | |
--ggds-motion-duration-base | 220ms | |
--ggds-motion-duration-slow | 360ms | |
--ggds-motion-duration-stagger | 40ms | Delay between items that appear one after another. |
--ggds-motion-easing-standard | 0.2,0,0,1 | |
--ggds-motion-easing-enter | 0.16,1,0.3,1 | |
--ggds-motion-easing-spring | 0.34,1.56,0.64,1 | A small overshoot: a pressed button springs back. |
Layers
Named layers for things that sit above the page, so a menu never ends up behind a sticky header. GGDS's CSS uses these names only, never raw numbers.
| Token | Value | Use |
|---|---|---|
--ggds-layer-base | 0 | |
--ggds-layer-raised | 10 | |
--ggds-layer-sticky | 100 | |
--ggds-layer-overlay | 400 | |
--ggds-layer-modal | 500 | |
--ggds-layer-toast | 600 |
Icons
GGDS has its own set of 143 line icons for government services, @ggds/icons, drawn on a 24px grid in the colour of the text around them. See all the icons, and how to use them with the icon component.
- Always put words next to an icon. An icon on its own is guessed differently by different people.
- Hide icons from screen readers (
aria-hidden="true"andfocusable="false"), because the words already say it. - Use the icon size tokens, and the text colour (
currentColor), so icons keep their contrast in every theme.