#ClimateEmergency

Typography

Open in Storybook Open in Figma

This page describes basic font and text components. See the Typography examples for examples on how to combine them.

The typography and spacing rules given here cover the basic appearance in George. Individual components (e.g. FunctionCard) might overrule some of these rules in certain cases. In such a case, those exceptions are described in the respective component pages of GDS.

Headlines

Headlines are set using <h1> to <h4> elements. Not all headlines are allowed in every context:

  • There is only one <h1> per page, serving as page title.
  • Exception to the initial rule: An open Modal counts as a page within a page (that traps the user inside of it), in this case the Modal title adds another <h1>.
  • Outside of George Store, <h1> on grey background have become obsolete, as the page title will be set in StripeHeader and Modal.
  • Two headlines can never follow each other directly.
  • <h2> and <h3> on grey background are used to structure main content.
  • <h2>, <h3>, and <h4> are used in cards for headlines. They all look the same. The actual level of the headline to use depends on the last headline used outside the card so that in pure text mode it is a continuation of the outer headline level.
Loading demo…
Loading demo…
Rules For Developers
  • DEPRECATED There used to be a line after <h1>, but it is no longer rendered. As a result, suppressing it with .g-no-line is not needed anymore. For the record, legacy <h1> that are followed by <hr> to mimick a line should be a thing of the past by now.
  • Apply .g-first to a headline if you want it to have no top margin – if it’s the first element on grey background.
  • There is no need to apply .g-first inside cards, even if the headline is the first element.
Rules For Designers
  • Headlines for all levels (<h1>..<h6>) use font-weight bold 700.
  • On grey background, …
    • <h1> has a font-size of 24px with 30px line-height,
    • <h2> has a font-size of 22px with 28px line-height,
    • <h3> has a font-size of 18px with 24px line-height,
    • <h4> has a font-size of 18px with 20px line-height,
    • <h5> and <h6> have a font-size of 16px with 20px line-height.
  • Inside cards, …
    • <h2>..<h6> inside cards all have a font-size of 18px with 24px line-height.
  • DEPRECATED <h1> used to be followed by 16px spacing, a line 1px / $color-gray-200 (#e4eaf0), and another 16px spacing to the following content.
  • <h2>..<h3> have 20px spacing to the following content.

Paragraphs

Regular text is set using <p> elements. Minor/smaller text is set by adding .g-small. Micro text is set by adding .g-micro. Faded text is set by adding .g-faded.

Loading demo…
Loading demo…

HINT Do not use unstyled text, always use <p> elements.

HINT As .g-small also adjusts the line height, it should be used on block-level elements. <small> elements may be used in addition inside any paragraph, and especially in those that have .g-small applied, to mark fine print semantically. But use of these elements does not result in any visual changes (e.g. no smaller font), only .g-small does.

HINT Avoid <br/> and convert them to <p> instead.

Rules For Designers
  • Regular paragraphs use 16px font-size with 24px line-height.
  • Small paragraphs use 14px font-size with 21px line-height.
  • Text colour on both white and grey background is $color-blue-400 (#0a285c).
  • Faded text colour on both white and grey background is $color-gray-400 (#537091).

Emphasis

George uses two kinds of emphasized text: bold and ‘quoted’. Bold is used if whole sentences are important. Quotes are used, if single words or short phrases within a sentence need to be emphasized:

Loading demo…
Rules For Copywriters
  • When using quote text, the correct language-specific opening and closing quotes have to be used.
Rules For Designers
  • Emphasised text elements inside components (e.g. date, title, amount in transactions, hyperlinks in paragraph text) use font-weight semi-bold 600.
  • Bold text is not allowed in small paragraphs, but hyperlinks are.

Ordinary in-line hyperlinks are set using <a> elements within <p> elements.

Loading demo…
Rules For Designers
  • Hyperlinks are presented in semi-bold 600 / $color-blue-300 (#135ee2).
  • Hyperlinks are underlined on hover and not otherwise.
  • Hyperlinks and Buttons have a visually similar focus state.

Lists

George lists come in different flavours. The List component is used to create unordered and ordered lists (<ul>, <ol>). If you need a definition list (<dl>), head over to the LabeledList component.

Variants

First and foremost, appearance of ordered and unorded lists is controlled via the variant prop.

With bullet points

This is the default, and what you get if you explicitly set List.VARIANT.BULLETS.

Loading demo…

With numbers

To display numbers as indicators, use List.VARIANT.NUMBERS. To see an example, scroll down to Ordered lists.

With checkmarks

George Store lists feature checkmarks instead of bullet points, so there you may want to set List.VARIANT.CHECKMARKS.

Loading demo…

Without an indicator

Plain lists (List.VARIANT.PLAIN) have no visual indication that they are lists at all, they look identical to a sequence of paragraphs.

Loading demo…

To completely remove styles, List.VARIANT.UNSTYLED exists. If you additionally make a plain List more compact, the margin between list items is removed, but the unstyled variant goes one step further, as it also removes the List’s outer margin.

Lists with custom icons

Loading demo…

Ordered lists

The List’s ordered prop turns an unordered list (<ul>) into an ordered one (<ul>).

Loading demo…
Rules For Developers
  • For backwards compatibility, the ordered prop changes the default of variant from BULLETS to NUMBERS.
  • But you can make any list an ordered list, including the one with bullet points, all you need to do is explicitely set a variant.
  • And vice-versa: Semantically speaking, a numbered List does not need to be ordered. But given that it will look like an ordered list visually, we recommend to always set ordered for Lists that have List.VARIANT.NUMBERS. As mentioned, this is something you get for free if you just set ordered, as shown in the example above.

Compact lists

You can add set the compact prop, which eliminates spacing between list items.

Loading demo…

Small and faded lists

There are even more options, you can make a List display with faded and/or small text.

If a List is part of legal text (i.e., a region with the .g-small modifier applied), small is automatically applied. In George Store, legal text is usually faded too.

Separators

A 1px divider line can be created using the Separator component. It comes with some spacing before & after, which can be removed with the compact prop.

When the thematicBreak prop is set, Separator will turn into a thematic break (a.k.a. horizontal rule). To quote MDN:

The <hr> HTML element represents a thematic break between paragraph-level elements: for example, a change of scene in a story, or a shift of topic within a section.

This is why we only care about the visual aspect of the component, make sure to only use thematicBreak when it makes semantic sense.

Loading demo…

Variations

Variations for the aforementioned typographic building blocks exist. So when used under the following specific circumstances, you may encounter certain areas of markup with an alternate look and feel.

Tabular numbers

If you need alignment for numeric values, you can add the .g-tabular modifier.

HINT In the example below, the dates and amounts on the left have the modifier applied; on the right without modifier for comparison.

Loading demo…

Sections containing legal text can be marked up with .g-small. Legal text is presented in smaller font size. For more information check out the legal text example in our Typography examples.

Rules For Designers
  • Legal text uses a smaller font, which is then inherited by
    • paragraphs and lists,
    • but not headlines.

Miscellaneous

Selected text

George uses native colours provided by the operating system (or web browser) for selected text.

Loading demo…

Text spacing

Due to rem rounding errors, spacings are usually +/-1px correct.

Loading demo…
Rules For Designers
  • Headlines, except the first one in a container, are preceded by 40px spacing.
  • Paragraphs are preceded by 20px spacing.
  • Lists and list items use the same vertical spacing as paragraphs.
  • Separators keep 16px spacing above/below to another element (this overrules other spacing rules).