Themes
A theme gives a website its institution's colour. Everything else stays the same on every government website.
What a theme changes
A theme is one colour. GGDS works out a deeper shade of it and uses the two in five places only: the line under the header, the institution's name, the homepage hero, the footer, and the institution's card in a list.
Links, buttons, form fields and messages never change colour. Someone who has used one government website can then use any other. In the previews below, the button and the link look the same in every theme.
Make a theme
Type or pick your institution's colour. The builder checks that it can be read, shows it on a page, and gives you the theme to copy or download: a stylesheet for developers and design tokens for designers. If the colour is too light, it suggests the nearest shade that passes.
The theme builder needs JavaScript. Without it, make a theme on the command line with npx @ggds/themes '#rrggbb': see make a theme in code.
- Your colour
-
#005f8f - Deep shade
-
#005d8c
| Where the colour is used | Contrast | Needs | Result |
|---|
Your theme files
For developers: the stylesheet, to load after ggds.css.
:root {
--ggds-color-institution: #005f8f;
--ggds-color-institution-deep: #005d8c;
}
For designers: the same colours as design tokens, to import into Figma.
{
"$description": "GGDS institution theme. Use these colours only on the header line, the institution name, the homepage hero, the footer and the institution's card in a list.",
"color": {
"$type": "color",
"institution": {
"default": {
"$value": "#005f8f",
"$description": "The institution colour (6.9:1 on white). Header line, institution name, cards."
},
"deep": {
"$value": "#005d8c",
"$description": "The deep shade for the hero and footer (7.1:1 under white text)."
}
}
}
}Or make the same file on the command line. The address of this page also keeps your theme, so you can share it.
npx @ggds/themes '#005f8f' --out theme.cssReady-made themes
These use each institution's current website colour. Each institution still has to confirm its colour, so treat them as provisional. To change one, open it in the builder.
-
Ministry of Communication, Digital Technology and Innovations
MoCDTI
What do you need help with?
-
Cyber Security Authority
CSA
What do you need help with?
-
Data Protection Commission
DPC
What do you need help with?
-
Ghana Digital Centres Limited
GDCL
What do you need help with?
-
Ghana Domain Name Registry
GDNR
What do you need help with?
-
Ghana Investment Fund for Electronic Communications
GIFEC
What do you need help with?
-
Ghana Meteorological Agency
GMet
What do you need help with?
-
Ghana Post Company Limited
Ghana Post
What do you need help with?
-
Ghana-India Kofi Annan Centre of Excellence in ICT
GI-KACE
What do you need help with?
-
National Communications Authority
NCA
What do you need help with?
-
National Information Technology Agency
NITA
What do you need help with?
-
Postal and Courier Services Regulatory Commission
PCSRC
What do you need help with?
See any theme on a whole page: open a template in the showcase and choose the theme at the top.
Use a theme on your website
The default theme, MoCDTI's, comes with ggds.css: you need nothing else. For any other theme, load its stylesheet after ggds.css. A ready-made theme has a name from the table above. A theme you made is the file you downloaded.
Any website
<link rel="stylesheet" href="ggds/ggds.min.css">
<link rel="stylesheet" href="ggds/themes/<theme>.css">React, Astro, Vite and other builds with npm
npm install @ggds/css @ggds/themesimport '@ggds/css/ggds.css';
import '@ggds/themes/<theme>.css'; // or your own file: import './theme.css';Django
Name the theme in {% ggds_assets %}. For a theme you made, save the file as static/ggds/themes/<name>.css in your project and use that name.
{% load ggds %}
{% ggds_assets theme="<theme>" %}WordPress
In Appearance > Customise > GGDS, choose your institution's theme.
Several institutions on one page
For a page that shows several institutions, such as a list of a ministry's agencies, load themes.css and mark each one with data-ggds-theme. For an institution without a ready-made theme, give it a theme name in the builder (or --slug on the command line): its file then themes only the parts marked with that name.
<link rel="stylesheet" href="ggds/themes/themes.css">
<li class="ggds-card ggds-card--institution" data-ggds-theme="nca">…</li>
<li class="ggds-card ggds-card--institution" data-ggds-theme="gmet">…</li>Themes are stylesheets, never inline styles, so they work on websites with a strict Content Security Policy. Never set the colours in a style attribute.
Make a theme in code
The command line makes the same files as the builder, with no code to write. It needs Node.js.
npx @ggds/themes check '#7fb3d5' # does it pass? If not, the nearest shade that does
npx @ggds/themes '#006e35' --out theme.css # the stylesheet
npx @ggds/themes '#006e35' --format tokens --out theme.tokens.json # design tokens
npx @ggds/themes '#006e35' --slug my-agency # only for data-ggds-theme="my-agency"
npx @ggds/themes list # the ready-made themesIn a build script, use the functions the command line uses, from @ggds/tokens/institution.mjs. They work in the browser too.
import { checkInstitutionColour, institutionCss, institutionTokens } from '@ggds/tokens/institution.mjs';
checkInstitutionColour('#7fb3d5'); // { ok: false, suggestion: '#577b92', checks: [...], ... }
institutionCss('#006e35'); // the stylesheet for the whole site
institutionCss('#006e35', { slug: 'my-agency', name: 'My Agency' });
institutionTokens('#006e35'); // design tokens (W3C format)Use a theme in Figma
Each theme comes as design tokens in the W3C format, with the same names developers use: color/institution/default and color/institution/deep. So a design and the website it becomes use the same colours.
- Download the tokens: Figma tokens in the table of ready-made themes, or Download theme.tokens.json in the builder.
- In Figma, open Local variables and choose Import. Choose the file. For several institutions, import each file as a mode of the same collection, then switch modes to see a design in each theme.
- Use
color/institution/defaultfor the header line, the institution name and cards, andcolor/institution/deepfor the hero and footer. Nowhere else.
The files also work with Tokens Studio and Style Dictionary. The other GGDS colours, sizes and spacing are on Foundations.
The rules every theme keeps
- The colour has at least 4.5:1 contrast on white, because the institution's name is written in it.
- The deep shade has at least 7:1 contrast under white text and 4.5:1 under the gold purpose line. GGDS darkens your colour only as far as that needs, so it keeps its hue.
- A theme cannot change links, buttons, focus, form fields or messages.
The builder, the command line and the website build all use the same rule, so a theme that passes in one passes in all of them.