Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the GOV.UK Frontend responsive typography scale #2289

Open
20 of 25 tasks
owenatgov opened this issue Aug 1, 2022 · 3 comments
Open
20 of 25 tasks

Improve the GOV.UK Frontend responsive typography scale #2289

owenatgov opened this issue Aug 1, 2022 · 3 comments
Assignees
Labels
epic Epics are used in planning project boards to group related stories typography

Comments

@owenatgov
Copy link
Contributor

owenatgov commented Aug 1, 2022

What

We're planning to update the GOV.UK Frontend typography scale to make it more accessible.

Specifically, we intend to:

  • remove 14 (14 px on desktop, 12 on mobile) as an option on the font scale
  • set 16 to not drop to 14px on mobile but stay at 16 across all screen sizes
  • set 19 to not drop to 16px on mobile but stay at 19 across all screen sizes
  • review our line heights across all screen and font sizes
  • realign our typography classes to all work off of the same “t-shirt size” sizing grid (xs to xl)
  • adjust the size of other headings on mobile so that the hierarchy maintains a standard body size of 19px (current m on the govuk body specific font scale, will be s across all typography classes with this work)

Why

We’re doing this to assess how GOV.UK Frontend approaches typography on mobile. The way we’ve been handling responsive typography up to now, in line with the norms of digital design at the time of GOV.UK’s inception, is to specify a standard size on desktop and then treat mobile as a smaller variant. Over the past decade, this idea has shifted as screen sizes and device usage has changed. It is now preferable to provide a standard size on desktop, and “as big as is comfortable for the interaction type” on mobile. That means sizing interactive pieces to be used with thumbs instead of on-screen pointers, and sizing fonts to be readable from a range of up to half a metre (an arm’s length).

This perspective is also informed by the following:

We carried out some polling of the community in the previous spike into this topic and found that 14 on the font scale had very low usage and very few, if any, valid use cases among the community.

You can see what this looks like in our first draft implementation, put together as part of the spike mentioned above.

As part of this, we are additionally planning on aligning our t-shirt sizing classes in order to ensure that there is a consistent correlation across our typography between actual size on our font scale and letter size and on the hypothesis that applying a letter to our font sass mixins make it easier for teams to understand when using it.

Epic lead

Owen

Who needs to work on this

Designers; Developers; Content designers; Accessibility specialists

Done when

Before publishing

Tasks

  1. design typography
  2. community typography
    owenatgov
  3. 3 of 3
    accessibility design typography
    owenatgov
  4. sass / css typography 🔍 investigation
    owenatgov
  5. sass / css typography
    owenatgov
  6. accessibility design typography
    christopherthomasdesign owenatgov
  7. community typography
    owenatgov
  8. 2 of 3
    epic guidance typography
    christopherthomasdesign

Small stories off of manual testing

These will be merged into the new scale branch before initial release

Tasks

  1. footer typography
    owenatgov
  2. panel typography
    owenatgov
  3. panel typography
    owenatgov
  4. phase banner typography
    owenatgov
  5. fieldset typography
    owenatgov
  6. tag typography 🔍 investigation
    CharlotteDowns owenatgov

5.1

Includes some refactoring of our components which we will group together in the comms for the release as preparation for the typography to advertise it.

Tasks

  1. sass / css typography
    owenatgov
  2. checkboxes radios typography
    owenatgov
  3. header typography
    owenatgov
  4. text input typography
    owenatgov
  5. sass / css typography
    querkmachine

5.2

Tasks

  1. typography
  2. typography
    christopherthomasdesign owenatgov

6.0

Tasks

  1. sass / css typography
  2. breaking change typography
  3. breaking change typography
  4. feature request sass / css typography 🕔 hours
@owenatgov owenatgov added awaiting triage Needs triaging by team epic Epics are used in planning project boards to group related stories typography and removed awaiting triage Needs triaging by team labels Aug 1, 2022
@36degrees
Copy link
Contributor

We'll need to think about how this works alongside GOV.UK Template / Frontend Toolkit / Elements (the 'legacy codebases') and 'compatibility mode'.

At the minute, the font sizing for the legacy codebases and GOV.UK Frontend are very similar, other than small some differences in line height etc.

However, with this change, where there is a mix of content from the legacy codebases and GOV.UK Frontend, then anything from the legacy codebase will continue to shrink to 16px on mobile, and anything from GOV.UK Frontend will not.

This can be seen in some of the full page examples (which show content from the legacy codebases mixed in) in Chris's spike (alphagov/govuk-frontend#2421):

Applicant Details

govuk-frontend-pr-2421 herokuapp com_full-page-examples_applicant-details(iPhone SE) Medium

Renew your driving licence

govuk-frontend-pr-2421 herokuapp com_full-page-examples_renew-driving-licence(iPhone SE) (1) Medium

We might want to consider either:

  • keeping the old typography scale when compatibility mode is enabled
  • removing compatibility mode in the same release (which would be my preference)

@owenatgov
Copy link
Contributor Author

owenatgov commented Aug 19, 2022

We now have a release plan that we'll be working from when we are ready to do this work. Currently visible to team members only: https://docs.google.com/document/d/1G4-qz5INZ8196PmR1OSon46MyWy8V0GshErWeSsKmY0/edit#heading=h.iyendlupo5ih

@owenatgov
Copy link
Contributor Author

We will now longer be releasing this change in GOV.UK Frontend v5.0.

The 2 main reasons for this are:

  • With the number of changes coming in 5.0, we think that moving this change which will require a lot of auditing and changes from teams will enable them to move over to 5.0 more fluidly
  • We think that this work grouped nicely with our parallel work on WCAG 2.2 and some of the planned comms around this

We are now planning on releasing this initially as a minor v5 release behind a feature flag with a view to make the new typography scale the standard in 6.0.

@owenatgov owenatgov removed this from the v6.0 milestone Oct 12, 2023
oscarduignan added a commit to hmrc/hmrc-frontend that referenced this issue Jun 5, 2024
DO NOT MERGE

This is an example to use to discuss the impact of change / what we
should do about it with PTA and Design Resources - as it might need some
coordination and the actual change might be different - or contain
additional tweaks to make new font size fit (at the least)

alphagov/govuk-design-system#2289
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epic Epics are used in planning project boards to group related stories typography
Projects
None yet
Development

No branches or pull requests

4 participants