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

Add guidance for using heading classes and update examples #1974

Closed
wants to merge 11 commits into from

Conversation

edwardhorsford
Copy link
Contributor

@edwardhorsford edwardhorsford commented May 27, 2024

Description

Per discussions on Slack, this adds guidance for which heading classes to use. I started with the guidance from GOV.UK, and have then modified after several rounds of discussions.

Why do this?

NHSUK-Frontend currently styles headings by default - nhsuk-heading-xl for h1s, and nhsuk-heading-l for h2s. This results in very large headings which may not be suitable on transactional / shorter pages.

Service teams should choose appropriate heading sizes to visually balance on the page, but this nhsuk-frontend default likely means that many are using larger headings than they might choose otherwise, thinking it is recommended. GOV.UK faced a similar issue some years ago (not defaulted in code, but all examples used govuk-heading-xl), and added explicit guidance for headings and which is most appropriate.

Updating nhsuk-frontend to not default sizes or to change the default may be something to investigate in the future. In the short term we can add guidance for teams to suggest what sizes are appropriate.

Screenshot:

Screenshot 2024-06-07 at 11 56 20

Checklist

@edwardhorsford
Copy link
Contributor Author

Example of a question page before this change:
heading-xl

Example after change:
heading-l

frankieroberto
frankieroberto previously approved these changes Jun 7, 2024
@sarawilcox sarawilcox self-assigned this Jul 31, 2024
Copy link
Contributor

@sarawilcox sarawilcox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hope I've done this correctly. Have suggested changes.

app/views/design-system/styles/typography/index.njk Outdated Show resolved Hide resolved
app/views/design-system/styles/typography/index.njk Outdated Show resolved Hide resolved
app/views/design-system/styles/typography/index.njk Outdated Show resolved Hide resolved
app/views/design-system/styles/typography/index.njk Outdated Show resolved Hide resolved
@sarawilcox
Copy link
Contributor

#1974 (comment)

I think the above looks fine. I am looking at adding some guidance around not going down to a heading level 5 in terms of content structure. (That suggests that content is too complex.)

@sarawilcox
Copy link
Contributor

In branch https://github.com/nhsuk/nhsuk-service-manual/tree/review/1-release-7-0-0 awaiting final sign offs and release.

@anandamaryon1
Copy link
Contributor

Released as part of v7.0.0: #2040

@anandamaryon1 anandamaryon1 deleted the add-heading-size-guidance branch November 11, 2024 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

4 participants