-
Notifications
You must be signed in to change notification settings - Fork 318
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
Header component - long service names continue onto a new line #4953
Comments
Uh oh! @Chirag-Bhatti, the image you shared is missing helpful alt text. Check your issue body. Alt text is an invisible description that helps screen readers describe images to blind or low-vision users. If you are using markdown to display images, add your alt text inside the brackets of the markdown image. Learn more about alt text at Basic writing and formatting syntax: images on GitHub Docs.
|
Hi @Chirag-Bhatti, Thanks for the feedback, but I don't think that this is something we want to change at the moment. To go through it with a finer comb:
It's expected that the header change in height in response to its contents, including particularly long service names, navigational elements, search forms, and so on.
This is intentional, so that the GOV.UK logo and link is consistently located in the same position on every page.
This would mess with the hierarchy of the header's contents. The GOV.UK text is largest, followed by the service or product name, followed by navigation. We don't—and other teams shouldn't—aim to optimise the viewing experience favouring any particular screen size. Shrinking the service name to fit on one line on one viewport size just means there's a slightly narrower viewport or slightly higher zoom level where it now wraps instead. Embrace that text can wrap, rather than try to fight it.
I don't think this is something we want to do for consistency reasons. Service names and navigation changing places between different services isn't ideal, we'd want them to be consistently in the same place. Some of our current ongoing work involves potentially moving the service name out of the header, likely to appear below the GOV.UK logo instead, though that isn't a certainty at the moment.
We advise against using centre-aligned text for accessibility reasons. It can make content harder to read for users with literacy difficulties (e.g. dyslexia) or using screen magnifiers to read. I don't think adding the ability to apply additional as an option in the component itself is something we would do, as it's too situational and subjective to be of widespread use. This could be a situation that the recent Hopefully our stance here makes sense. Feel free to ask any follow up questions you might have. |
Context
When supplying a long service name to the header component, the service name may "overflow" onto a new line.
![Screenshot of a header with a long service name, causing words to spill onto a new line and making the header look untidy](https://private-user-images.githubusercontent.com/109098469/324916408-6d8c5cea-30af-4c2d-b7f8-c1fce8b72954.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg2Mjg1MDksIm5iZiI6MTcxODYyODIwOSwicGF0aCI6Ii8xMDkwOTg0NjkvMzI0OTE2NDA4LTZkOGM1Y2VhLTMwYWYtNGMyZC1iN2Y4LWMxZmNlOGI3Mjk1NC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNjE3JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDYxN1QxMjQzMjlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1lZTNhMzdkMzQwOTc1ODAyNmUzMDQ3NDRlMWI4Njk3NWMwZGE1YjhkNTRjNmQ5ZGI5YjM2Y2MwNzRiZDY1YzhjJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.etTuosIWD4E5A0zq0OZxDlbJlG1jMNp6QTDfsy8Axdc)
See screenshot for example:
Though not a problem in itself, it can make the header and service name look untidy and harder to read.
It also seems the GOV.UK part of the header won't centre vertically in the header, and sits towards of the top instead which can look odd.
A few options that might be useful for such scenarios are:
Related component
This relates to the existing header component here
The text was updated successfully, but these errors were encountered: