Design

Changing text size, weight and line height

You might need to adjust the font size or font weight of an element outside of the predefined heading and paragraph classes.

For this you can use the font utility classes. There are 2 weights you can choose from, either display or default and 7 sizes ranging from xs to xxxl within each weight for adjusting font size.

It's unlikely you'll need to adjust line spacing but if you do there are 3 options, default space, heading space and no space.

Display weight classes

To help separate semantic meaning from visual appearance, utility classes can be applied to heading elements to change their size and weight. Utility classes that adjust or give the appearance of headings are known as 'display weight' classes. These classes can be applied to various elements such as heading, paragraph, span and div tags to give text the appearance of a heading.

Basically these are the classes you use if you want to change the size of heading or make a paragraph tag look like a heading.

Example

Display weight


XXXL - heading 1

XXL - heading 1

XL - heading 1

LG - heading 1

MD - heading 1

SM - heading 1

XS - heading 1


MD - display class appled to div

MD - display class appled to paragraph tag

<h4>Display weight</h4> <hr> <h1 class="qld__display-xxxl">XXXL - heading 1</h1> <h1 class="qld__display-xxl">XXL - heading 1</h1> <h1 class="qld__display-xl">XL - heading 1</h1> <h1 class="qld__display-lg">LG - heading 1</h1> <h1 class="qld__display-md">MD - heading 1 </h1> <h1 class="qld__display-sm">SM - heading 1 </h1> <h1 class="qld__display-xs">XS - heading 1 </h1> <hr> <div class="qld__display-md">MD - display class appled to div</div> <p class="qld__display-md">MD - display class appled to paragraph tag </p>

Default weight

These utility classes adjust or give the appearance of body text, they are known as 'default weight' classes. These classes can also be applied to various elements such as heading, paragraph, span and div tags to give text the appearance of a heading.

Basically, these are the classes you use if you want to change the size of paragraph or make a heading element look like normal body text. They're most often used when you want to adjust the font-size text within your content when abstract or caption text isn't appropriate.

Example

Default weight


Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Lorem ipsum dolor sit amet, consectetur adipiscing elit.


MD - default class appled to div

MD - default class applied to heading tag

<h4>Default weight</h4> <hr> <p class="qld__default-xxxl">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p> <p class="qld__default-xxl">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p> <p class="qld__default-xl">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p> <p class="qld__default-lg">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p> <p class="qld__default-md">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p> <p class="qld__default-sm">Lorem ipsum dolor sit amet, consectetur adipiscing elit. </p> <p class="qld__default-xs">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p> <hr> <div class="qld__default-md">MD - default class appled to div</div> <h4 class="qld__default-md">MD - default class applied to heading tag</h4>

Line spacing (line height)

Line spacing may also be known as line height. By default, all text elements will use the appropriate line height for their font size, this has been calculated using the Design System's base line grid system with all values being multiples of 4px. You can however apply utility classes which can apply alternative spacing values to either heading space which is slightly tighter or no space which sets the line height to match the font size.

Changing line height values isn't recommended, however it can be useful to assist with vertical alignment of single-line text elements within a container. It may also be useful for some specific design contexts, for example you might want a more compact or dense look, and a line-height equal to the font size could achieve that. Adjusting line height should be done carefully and tested thoroughly to ensure it doesn't negatively impact readability.

Example

Default


XXXL
XXL
XL
LG
MD
SM
XS

Heading


XXXL
XXL
XL
LG
MD
SM
XS

Nospace


XXXL
XXL
XL
LG
MD
SM
XS
<div class="row example-lineheight"> <div class="col-xs-4"> <h4>Default</h4><hr> <div class="qld__default-xxxl">XXXL</div> <div class="qld__default-xxl">XXL</div> <div class="qld__default-xl">XL</div> <div class="qld__default-lg">LG</div> <div class="qld__default-md">MD</div> <div class="qld__default-sm">SM</div> <div class="qld__default-xs">XS</div> </div> <div class="col-xs-4"> <h4>Heading</h4><hr> <div class="qld__default-xxxl qld__heading-space">XXXL</div> <div class="qld__default-xxl qld__heading-space">XXL</div> <div class="qld__default-xl qld__heading-space">XL</div> <div class="qld__default-lg qld__heading-space">LG</div> <div class="qld__default-md qld__heading-space">MD</div> <div class="qld__default-sm qld__heading-space">SM</div> <div class="qld__default-xs qld__heading-space">XS</div> </div> <div class="col-xs-4"> <h4>Nospace</h4><hr> <div class="qld__default-xxxl qld__no-space">XXXL</div> <div class="qld__default-xxl qld__no-space">XXL</div> <div class="qld__default-xl qld__no-space">XL</div> <div class="qld__default-lg qld__no-space">LG</div> <div class="qld__default-md qld__no-space">MD</div> <div class="qld__default-sm qld__no-space">SM</div> <div class="qld__default-xs qld__no-space">XS</div> </div> </div>

Research and rationale

Font size

Building on the research conducted by the DTA we chose to base our typography on the font-grid system that they developed. A typographic scale was used to create a set of font-size and line-height values which have been designed for legibility and can be easily implemented by designers or developers with a predictable output (Digital Transformation Agency, 2018).

Using the Design System's typography values means any object containing text is more likely to align with another element. This appearance of a baseline grid is created by automatically rounding the line-heights to the nearest grid value 4px, then converting them back to a unit-less value.

Where we chose to deviate from the presets defined by the Digital Transformation Agency was in our mobile site design where we found the H1 and H2 were too large. We did this for 2 reasons.

  1. Improved Readability: On a smaller screen, large text can appear overwhelming and may not fit well within the screen's width. Reducing the size of your headings can make your content easier to read and navigate.
  2. Better Use of Space: Smaller headings take up less space, allowing more content to be visible on the screen at once. This can be especially important on mobile devices, where screen real estate is limited.

When designing our fonts size, we also looked at the default size, letter spacing and font weights from Google's material design. Having developed the fonts, their type scale generator was a good baseline to compare our font sizes against.

Heading sizes

All HTML standard heading levels are supported by the headings component when used within .qld__body .

Similar to other Design Systems our H1 element doesn't use the largest font-size provided by the system which is xxxl as that size is intended for large promotions or splash-sections and is too large to be used in normal body copy (Digital Transformation Agency, 2018).

Modifier or utility classes

We have added classes to modify font size and weight. These were provided to help separate semantic meaning from visual appearance in order to better support WCAG2.0 Criterion 1.3.2.

1.3.2 Meaningful Sequence:
When the sequence in which content is presented affects its meaning, a correct reading sequence can be programmatically determined. (Level A)

This means designers and developers using the Design System can continue to use the correct heading level for the page structure while retaining a style that doesn't interfere with visual comprehension. For example, having a H2 in a sidebar that looks as small as a H4. This was a solution that we inherited directly for the Digital Transformation Agency's core font system (Digital Transformation Agency, 2018).

Maximum width paragraphs

Paragraphs are given a maximum width inside body to optimise readability across multiple lines of text. The Web Content Accessibility Guidelines recommend that lines of text don't exceed 80 characters in length (Digital Transformation Agency, 2018).

This option can be overwritten by changing the .qld__max-width however it isn't recommended.

Why Noto sans?

Our reason to endorse Noto Sans as the typeface for the Design System is based on the the research conducted by the Department of Premiers and Cabinet. They conducted a review of multiple fonts, looking to create consistency across print and digital application, minimise cost, improve digital legibility and to ensure corporate identity could be easily adaptable for future communications technologies.

They reviewed different open source type face looking at their ability to meet the following criteria:

  • suitability for both print and online applications
  • open-source (cheaper and available for all users)
  • avoiding letter mirroring (to assist with dyslexia/ readability issues)
  • distinct characters (e.g. capital I / 1, B / 8, O / 0, i / j)
  • a strong tail on the Q to avoid confusion with O
  • good spacing between letterforms
  • multiple weights and styles, including condensed and italics
  • variation in thick/thin strokes
  • large x-height (assists in readability)
  • works at all scales (e.g. for large format printing)
  • distinct numerals
  • good kerning and word spacing
  • 1.2.2 Resize text (Level AA) standard – text can be resized without assistive technology up to 200%.

What they found was that the 2 best fonts were Noto Sans and Lato. Noto Sans was determined to be the best option however because it met more of the criteria and had the best multi-language support.

Commissioned by Google, the Noto family is designed with the goal of achieving visual harmony (e.g. compatible heights and stroke thicknesses) across multiple languages/scripts.

Where does Meta fit in?

While Nota Sans is the official typeface for the Design System, Meta having been the standard Queensland Government print font for many years is likely to still play a role in many sites branding. Unit Noto Sans is officially endorsed as the new standard for corporate ID, Meta should be used for headings and agency/site names.

In our Design System we endorse the use of Meta only in situations such as promotional text and site names. This allows a site to use these prominent digital brand elements in a way to match their tradition media. Meta isn't approved for body copy, buttons or small text, as it isn't as legible as fonts designed specifically for the web.

FF Meta is a version of Meta that's available from Adobe Typekit which can be used as a web font.

Why system fonts as a fallback

Like the Digital Transformation Agency, we chose to use system fonts as a fallback in our font stack. The use of system fonts in government services enhances download speed and accessibility for all users, particularly those with low-end devices or remote internet connections, while also leveraging the improved aesthetics of modern typefaces in new operating systems (Digital Transformation Agency, 2018).