Skip to main content

This is a draft (version 0.5.0). The National Information Technology Agency (NITA) plans to make GGDS official guidance for government websites after independent accessibility testing. What this means

Ghana Government Design System Design system for Government of Ghana websites – home Search

Content

Prose (rich text)

Styles for text from a content management system.

When to use

  • Around HTML written in a content management system (CMS), such as a Wagtail rich text field or a WordPress post body.

When not to use

  • Around GGDS components or forms. They have their own styles.
  • Around the whole page. Wrap only the CMS text.

How to use

  • Wrap the content in ggds-prose. It styles headings h2 to h4, paragraphs, lists, links, quotes and tables, and keeps lines to a comfortable reading length.
  • Clean the HTML before you show it. GGDS only styles it; your website must remove unsafe code first, with an allow-list of tags. Remove pasted style attributes and fonts too.
  • Start CMS headings at h2. The page title is the only h1.
  • Wrap tables in ggds-table-wrap when you clean the HTML. Without it, table cells break long words so the table squeezes onto a narrow screen, but wide tables still need the wrapper.
  • For a link to a document, say what it is and how big: "Licence guide (PDF, 2 MB)". Many people pay for data by the megabyte.

Do

  • Write link text that says where it goes: "Apply for a licence".
  • Use real lists, not lines starting with dashes.

Don't

  • Write "click here" or "read more".
  • Pick a heading level for its size.

Accessibility

What GGDS does

  • Links are underlined, so they are not shown by colour alone (WCAG 1.4.1).
  • Headings, lists and quotes are styled so their structure is visible.
  • Images shrink to fit the screen.

What you need to do

  • Keep headings in order (h2, then h3) without skipping levels, so screen reader users can move through the page (WCAG 1.3.1).
  • Make every link make sense on its own (WCAG 2.4.4).
  • Give every image alt text, or alt="" when it is decoration.
  • Clean the HTML before you show it: GGDS only styles it.

Example: Rich text from a CMS

Open this example on its own page

HTML code for “Rich text from a CMS”
HTML
<div class="ggds-prose">
  <h2>Who needs a licence</h2>
  <p>You need a licence to provide <a href="/services/">internet or voice services</a> to the public in Ghana.</p>
  <ul>
    <li>internet service providers</li>
    <li>mobile network operators</li>
    <li>community and commercial broadcasters</li>
  </ul>
  <h3>Exemptions</h3>
  <p><strong>Private networks</strong> used only inside one organisation do not need a licence.</p>
  <blockquote><p>Every operator shall publish its tariffs.</p></blockquote>
  <table>
    <caption>Processing times</caption>
    <thead><tr><th scope="col">Application</th><th scope="col">Time</th></tr></thead>
    <tbody><tr><td>New licence</td><td>30 working days</td></tr><tr><td>Renewal</td><td>10 working days</td></tr></tbody>
  </table>
</div>
JSX (React)
<div className="ggds-prose">
  <h2>Who needs a licence</h2>
  <p>You need a licence to provide <a href="/services/">internet or voice services</a> to the public in Ghana.</p>
  <ul>
    <li>internet service providers</li>
    <li>mobile network operators</li>
    <li>community and commercial broadcasters</li>
  </ul>
  <h3>Exemptions</h3>
  <p><strong>Private networks</strong> used only inside one organisation do not need a licence.</p>
  <blockquote><p>Every operator shall publish its tariffs.</p></blockquote>
  <table>
    <caption>Processing times</caption>
    <thead><tr><th scope="col">Application</th><th scope="col">Time</th></tr></thead>
    <tbody><tr><td>New licence</td><td>30 working days</td></tr><tr><td>Renewal</td><td>10 working days</td></tr></tbody>
  </table>
</div>

Use it

Stylesheet
ggds.css includes it. To load only the parts you use: core.css, then components/prose.css (0.4 KB with gzip, minified).
JavaScript
None needed.

HTML

Copy the HTML under each example above. It works in any website.

Astro

No Astro component: copy the HTML.

React and Next.js

No React component: switch the HTML under an example to JSX (React) and copy it.

Django

With ggds-django ({% load ggds %}):

Text
{# Wagtail: a RichTextField, cleaned by Wagtail #}
<div class="ggds-prose">{{ page.body|richtext }}</div>

Classes and states

Classes for prose (rich text)
ClassWhat it does
.ggds-proseStyles the headings, lists, links, quotes and tables inside it, as text from a CMS arrives.

Accessibility tests

Automated, on every change

These run each time GGDS changes. A change that fails one is not accepted.

  • WCAG 2.2 A and AA rules (axe), at desktop and phone widths, on every example
  • No sideways scrolling on a 320px screen, also with a wide font, on every example
  • Every approved colour pair meets its contrast minimum, for every institution theme
  • No inline scripts or styles, so it runs under a strict Content Security Policy

By people, with assistive technology

Automated tests find only some of the barriers people meet. These checks are still to be done.

Manual accessibility checks for prose (rich text)
CheckResultNotes
Keyboard onlyNot tested yetWaiting for the external audit with disabled people (decision D-09).
NVDA screen reader with Firefox or Chrome (Windows)Not tested yetWaiting for the external audit with disabled people (decision D-09).
JAWS screen reader with Chrome (Windows)Not tested yetWaiting for the external audit with disabled people (decision D-09).
VoiceOver screen reader with Safari (iPhone)Not tested yetWaiting for the external audit with disabled people (decision D-09).
TalkBack screen reader with Chrome (Android)Not tested yetWaiting for the external audit with disabled people (decision D-09).
Zoom to 400%, and increased text spacingNot tested yetWaiting for the external audit with disabled people (decision D-09).
Windows contrast themes (forced colours)Not tested yetWaiting for the external audit with disabled people (decision D-09).
Voice control (Voice Access or Dragon)Not tested yetWaiting for the external audit with disabled people (decision D-09).

Changes

Changes to prose (rich text), newest first
VersionChange
0.2.0Fuller guidance for tags, breadcrumbs, disclosures, the skip link, pagination, rich text, tables and tab links.
0.1.0Added.

Every change, in What’s new

  • Table

    Tables for data people need to compare, such as fees or opening hours.

  • Disclosure and accordion

    Sections people can open and close, such as questions and answers.

Back to top

Something wrong, unclear or missing? Report a problem with this page or suggest a change to it on GitHub. You need a GitHub account.