-
Notifications
You must be signed in to change notification settings - Fork 331
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
Warning text does not support multi-line #3868
Comments
Hi @Jamesking56, Can you elaborate on what you mean 'the icon looks a bit strange'? As far as I can tell from your screenshot this is working as designed. |
It looks high up stuck in the top left? |
This is currently working as designed – there was a change made back in 2019 to vertically align the icon with the first line of the text:
Have you seen any evidence that users are confused by this? What would you expect the component to do when there are multiple lines of text? |
I would expect it to look like this: I haven't seen evidence of user confusion but if there was text above that isn't included in the warning, wouldn't the high up icon then cause confusion which parts of the text it is for? |
Hi @Jamesking56 Thanks for raising this, you're not the first to bring it up! We placed the icon at the top left because it ensures the warning icon is within the path of people using screen magnification tools. The icon is important for understanding that the text is a warning, and not just some bold text. For longer blocks of warning text, you could miss that context. I personally agree that it looks a bit strange when it sticks out above the top of a large block of text. I think ideally it'd be vertically centre-aligned when there's just one line of text, and aligned to the top of the text block when it runs over 2 or more lines. But we're not aware of a way to do this reliably in CSS. So we decided the accessibility consideration trumped the aesthetic one in this case. Hope that makes sense. |
@christopherthomasdesign Excellent explanation! I agree accessibility should triumph here 👍 |
@Jamesking56 Given the information above, are you happy for us to close this issue? |
Yes can be closed |
Description of the issue
https://design-system.service.gov.uk/components/warning-text/
The warning text component does not support text that drops onto multiple lines
Steps to reproduce the issue
The icon looks a bit strange when the element is showing multiple lines of information
Actual vs expected behaviour
The text was updated successfully, but these errors were encountered: