Pagination in stacked mode relies on whitespace for correct text alignment #3554
Labels
🐛 bug
Something isn't working the way it should (including incorrect wording in documentation)
pagination
Description of the issue
When in stacked (block) mode (no page numbers displayed), the pagination component relies on whitespace in the HTML to align the 'Previous' and 'Next' text with the labels below.
If there's no whitespace between the
govuk-pagination__icon
SVG and thegovuk-pagination__link-title
span, the 'Previous' or 'Next' link is displayed about 4 pixels too far to the left.With whitespace:
Without whitespace:
(The text is actually slightly misaligned even in the first version - 'Previous' aligns with the end of the underline on the label rather than the first letter - I'm not sure if this is intentional)
Steps to reproduce the issue
Open this Design System pagination example in Firefox, right-click > Inspect the link, expand the
<a>
tag, click the whitespace node and press DeleteActual vs expected behaviour
I would expect the text alignment to not rely on whitespace in the HTML. In my particular case (a Vue component library) I have no control over whether consumers of the library will have the whitespace compression option enabled or not, though by default it's enabled
There's been a previous issue with whitespace causing layout changes in the header component, and there appears to be a fix for a similar issue when pagination is used in list mode:
govuk-frontend/src/govuk/components/pagination/_index.scss
Lines 57 to 61 in eed94f8
Environment (where applicable)
The text was updated successfully, but these errors were encountered: