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 a space before homepage heading dash #3841

Merged
merged 1 commit into from
Nov 3, 2023

Conversation

hannalaakso
Copy link
Member

@hannalaakso hannalaakso commented Nov 2, 2023

What

We recently swapped the punctuation in the visually hidden text in the new homepage heading from a colon to a dash, but didn't include a space in front of the dash. This wasn't obvious visually or when tested with screen readers since the visually hidden text inserts a space character before it. However if the user turns off their stylesheets, there wouldn't be a space character before the dash and this is the version that search engines receive as well.

(This also makes https://trello.com/c/kroI3kLZ/684-stop-extra-whitespace-being-added-inside-homepage-h1 redundant although as noted on that ticket, we might need to look into being able to control whitespace in templates in the future if another use case for needing this comes up. )

Why

So that search engines and users who turn off stylesheets get the space before the dash.

Screenshots?

Before (when stylesheets are turned off)

Screenshot 2023-11-02 at 14 21 41

After (when stylesheets are turned off)

Screenshot 2023-11-02 at 14 21 15

Tested in

I did some testing with screen readers to check that they aren't now announcing two spaces since the visually hidden text contains a space too. (Although I had actually already tested in alphagov/govuk-frontend#3836 that the space before visually hidden text doesn't result in double spaces when there's text before the visually hidden text so my testing for this PR was just a quick check to confirm that).

JAWS 2023 with Chrome

Screenshot 2023-11-02 at 15 37 53

NVDA 2023 with Chrome

heading level 1 GOV.UK - The best place to find government services and information

⚠️ This repo is Continuously Deployed: make sure you follow the guidance ⚠️

@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-3841 November 2, 2023 14:31 Inactive
@hannalaakso hannalaakso marked this pull request as ready for review November 2, 2023 15:43
@hannalaakso hannalaakso force-pushed the add-space-before-homepage-heading-dash branch from 3a4f212 to e6f00dc Compare November 2, 2023 17:26
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-3841 November 2, 2023 17:26 Inactive
We recently swapped the punctuation in the new visually hidden text in the homepage heading from a colon to a dash, but didn't include a space in front of the dash. This wasn't obvious visually or when tested with screen readers since the visually hidden text inserts a space chacter before it. However if the user turns off their stylesheets, there wouldn't be a space character before the dash.
@MartinJJones MartinJJones force-pushed the add-space-before-homepage-heading-dash branch from e6f00dc to 516b0d0 Compare November 3, 2023 10:05
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-3841 November 3, 2023 10:06 Inactive
@MartinJJones MartinJJones self-requested a review November 3, 2023 10:07
@MartinJJones MartinJJones merged commit d5f6f7e into main Nov 3, 2023
@MartinJJones MartinJJones deleted the add-space-before-homepage-heading-dash branch November 3, 2023 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants