Styles - Typography

Our fonts and typographic styles, and how to apply them.

Font

Open Sans

Open Sans is a humanist sans serif typeface designed by Steve Matteson, Type Director of Ascender Corp. This version contains the complete 897 character set, which includes the standard ISO Latin 1, Latin CE, Greek and Cyrillic character sets. Open Sans was designed with an upright stress, open forms and a neutral, yet friendly appearance. It was optimised for print, web, and mobile interfaces, and has excellent legibility characteristics in its letterforms.

Fallback font

Default to Arial when Open Sans isn't available.

font-family: “OpenSans”, Arial, sans-serif;

Headings

Open this headings typography example in new window
Copy headings typography code
<h1 class="hs2-heading-xl">hs2-heading-xl</h1>
<h2 class="hs2-heading-l">hs2-heading-l</h2>
<h3 class="hs2-heading-m">hs2-heading-m</h3>
<h4 class="hs2-heading-s">hs2-heading-s</h4>
<h5 class="hs2-heading-xs">hs2-heading-xs</h5>

Paragraphs

Body

The default paragraph font size is 19px on large screens and 16px on small screens.

You can also add classes to create a lead paragraph or smaller body copy to convey hierarchy in your page.

Lead paragraph

A lead paragraph is an introductory paragraph that you can use at the top of a page to summarise the content. Lead paragraphs use 24px type on desktop and should only be used once per page if needed.

Body small

You can use the hs2-body-s class sparingly to make your paragraph font size smaller: 16px on larger screens and 14px on smaller screens.

The majority of your body copy should use the standard 19px paragraph size.

Font override classes

You might need to set the font size or font weight of an element outside of the predefined heading and paragraph classes. For this you can use the font override classes in your HTML or reference the typography mixins in your own components.

Font size

The full HS2 typography scale goes from 14px up to 64px on large screens. You can add these font size override classes to any other typographic class or element and they will change the font size.

Open this sizes typography example in new window
Copy sizes typography code
<p class="hs2-u-font-size-64">hs2-u-font-size-64</p>
<p class="hs2-u-font-size-48">hs2-u-font-size-48</p>
<p class="hs2-u-font-size-32">hs2-u-font-size-32</p>
<p class="hs2-u-font-size-24">hs2-u-font-size-24</p>
<p class="hs2-u-font-size-22">hs2-u-font-size-22</p>
<p class="hs2-u-font-size-19">hs2-u-font-size-19</p>
<p class="hs2-u-font-size-16">hs2-u-font-size-16</p>
<p class="hs2-u-font-size-14">hs2-u-font-size-14</p>

Font weight

As with the font size, you can add a font weight override class to any other typographic class or element to change the font weight to regular or bold weight.

Open this weight typography example in new window
Copy weight typography code
<p class="hs2-u-font-weight-normal">hs2-u-font-weight-normal</p>
<p class="hs2-u-font-weight-bold">hs2-u-font-weight-bold</p>

Links are blue and underlined by default with a styled focus state for people who use keyboards or other devices to navigate through a page.

If your link is at the end of a sentence or paragraph, make sure that the linked text does not include the full stop.

If it's not helpful to distinguish between visited and unvisited states, for example when linking to pages with frequently-changing content use the hs2-link--no-visited-state modifier class.

Open this links unvisited typography example in new window

Lists

Use lists to make blocks of text easier to read, and to break information into manageable chunks.

Open this lists typography example in new window
Copy lists typography code
<ul class="hs2-list">
  <li><a href="#">Item one</a></li>
  <li><a href="#">Item two</a></li>
  <li><a href="#">Item three</a></li>
</ul>

Bulleted lists

Introduce bulleted lists with a lead-in line ending in a colon. Start each item with a lowercase letter, and do not use a full stop at the end.

Open this lists bulleted typography example in new window
Copy lists bulleted typography code
<p>Bulleted list items:</p>
<ul class="hs2-list hs2-list--bullet">
  <li>item one</li>
  <li>item two</li>
  <li>item three</li>
  <li>item four</li>
</ul>

Numbered lists

Use numbered lists instead of bulleted lists when the order of the items is relevant.

You do not need to use a lead-in line for numbered lists. Items in a numbered list should end in a full stop because each should be a complete sentence.

Open this lists numbered typography example in new window
Copy lists numbered typography code
<h3>Numbered list items</h3>
<ol class="hs2-list hs2-list--number">
  <li>Item one</li>
  <li>Item two</li>
  <li>Item three</li>
</ol>

Section break

You can use the hs2-section-break classes on an <hr> element to create a thematic break between sections of content. hs2-section-break has class-based modifiers for different size margins.

By default hs2-section-break is only visible by its margin. You can add the hs2-section-break--visible class to make it visible with a separator line.

Open this section breaks typography example in new window
Copy section breaks typography code
<hr class="hs2-section-break hs2-section-break--xl hs2-section-break--visible">
<hr class="hs2-section-break hs2-section-break--l hs2-section-break--visible">
<hr class="hs2-section-break hs2-section-break--m hs2-section-break--visible">
<hr class="hs2-section-break hs2-section-break--visible">

Text alignment

Left-align text in English. Text is left-aligned by default.

The straight edge of left-aligned text helps people who use screen magnifiers. It saves them having to search around the screen for the next line or item. People who use magnifiers may miss things that are not left-aligned.

Some people with cognitive differences have difficulty with blocks of text that are justified (aligned to left and right margins).

Only centre-align or fully justify text if you can show a clear user need.

Text alignment override classes

For translations into languages that run right to left, right-align instead. You need to use the text alignment override class in your HTML to right-align text.

Open this text alignment typography example in new window
Copy text alignment typography code
<p class="hs2-u-text-align-right">An example of right aligned text</p>