Fix postal address print styles #35
Conversation
The prior version was over 18 months old.
When printing, each part of the address was appearing on a single line, and the first line appeared above it as a header. Anyone printing these pages and then transcribing the address would likely send things to the wrong place. * Don’t use styled spans, use divs (empty divs will have a zero height, whereas spans with line breaks would create new lines for empty parts) * Don’t use a heading for the title
I assume there's no change to how this is rendered on the screen? Is the removal of the h3 harmful to screen readers? |
There's no change to the display, the h3 styles were being reset. This brings markup closer inline with how we render contacts elsewhere on GOV.UK. Addresses ought to be displayed using a component. Regarding screen readers, the first line of the address is part of the address not the heading for the address. If anything the previous heading was confusing. There isn't something that precedes these lines that says "this is a mailing/postal address" other than the "Post" heading a bit higher up. This would be something worth investigating when building out the component. cc @dsingleton |
LGTM |
I’m not too fussed, but personally I would have left it as spans, removed the span styling and added a
This works as well though, there’s no accessibility issues that I can think of. |
@robinwhittleton I tried that first although without extra logic it can leave gaps between lines in addresses for those that don't contain all parts. |
Fix postal address print styles
When printing, each part of the address was appearing on a single line, and the first line appeared above it as a header. Anyone printing these pages and then transcribing the address would likely send things to the wrong place.
https://trello.com/c/jT7QTzBb/145-fix-print-styles-on-addresses-medium
Before

## After