-
Notifications
You must be signed in to change notification settings - Fork 323
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
Improve Pagination component print styles #2800
Improve Pagination component print styles #2800
Conversation
By default `.govuk-link` print styles will output the `href` attribute in brackets after the link. For example: "Home (/homepage)". This is done with the `::after` pseudo selector. So when this was styled to increase the touch area of the pagination link it resulted in the bracketed information overlapping the component in a difficult to read way. By only applying this touch area improvement in the `screen` media context we avoid overwriting this inherited print style and allow the default `.govuk-link` behaviour to apply as usual.
029f7dd
to
80b47c3
Compare
Hi @NickColley! Finally getting into this. Very much appreciate the bugfix, deffo something we should've spotted during development 😅 However I'm going to be irritating and say this has prompted me to wonder if we should even show pagination on print and I wonder if it makes more sense to amend this PR to just hide it outright. What are your thoughts? If we wanted to just hide the whole thing, do you have capacity to amend this PR? |
@owenatgov my high level thought at this point is this:
Either with a CSS utility or sass variables.
I think this sort of thing is what I was getting at with the wider piece of work I'm interested in doing. I'd put together some proposals and we could weigh up the approach. That's what I was thinking by the extended piece of work. But what I've shared here is sort of how people are doing it in practice if you look at GOV.UK Publishing for example. |
So if you agree we should have a more thought out approach for print styles then we could get this in as is and then explore print styles as a whole as a bigger contribution. |
Maybe something like:
Or
I prefer the first one because I imagine most users wont think to configure this... |
Another bigger picture thing, but we may also have to consider manipulating the page content in preparation for printing too, such as expanding Details/Accordion sections. Conversely, doing that could be undesirable if a user is only interested in the content of one part of the page. |
@querkmachine that reminded me of something Frankie said about how they intentionally made accordions keep the state they are on the page when printed with the idea that the user might want to control that themselves. |
@NickColley I think this makes sense. Let's get this in for now to clear it up and start thinking about a more consistent print strategy soon. I'll review this next. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📄
Going to hassle the team for a 2nd review and then we're good to go on this as far as I'm concerned |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, this looks good to me, and agree we should have a think about print styles later.
Thanks for your time reviewing this, I'll leave it with you to merge as I have no power to merge I am a humble contributor :P |
By default
.govuk-link
print styles will output thehref
attributein brackets after the link. For example: "Home (/homepage)".
This is done with the
::after
pseudo selector.So when this was styled to increase the touch area of the pagination link
it resulted in the bracketed information overlapping the component in
a difficult to read way.
By only applying this touch area improvement in the
screen
media contextwe avoid overwriting this inherited print style and allow the default
.govuk-link
behaviour to apply as usual.In practice I think many GOV.UK Frontend users might hide this component from their print views so impact on end-users is low.
I'd be down for doing something more holistic as part of #573 if you're interested in that contribution (including thinking about it from a more high level design pov), but I noticed this just at a quick glance.
Screenshots