-
Notifications
You must be signed in to change notification settings - Fork 338
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
Add print styles to components #573
Comments
@36degrees I think our users such as GOV.UK Publishing will run into this pretty soon. |
I'm currently looking at print stylesheets for components using GOV.UK Frontend on GOV.UK, so this would be great 👍 |
✋ me too - I've put together something to make the accordion component readable when printed out, but it's got some not-so-nice |
👍 on this. When developing the accordion component, we had an interesting debate about whether, when printing a page, all of the accordions should be "opened" or not. My conclusion was that it probably made sense to keep them in the same state as the page, as the user may only want to print some of the sections (and if they really wanted to print them all then that’s fairly easy to do via the "Open all" button). |
The HMRC PAYE (classic) service has recently switched to using the design system GOV UK. The application offers users the ability to view-and-print previous years submissions - we use the check answers pattern to "play back" submitted details and provide a (JS) print button to open a print dialogue (note screenshots show test data): We've provided a form for users to provide feedback, and had several comments about printing. Here are some quotes:
(we have more feedback available on request) It would be great if the design system could provide more print styling that address some of these issues, though I appreciate finding one approach that fits all potential printing needs isn't trivial In the meantime, we've loaded the following additional styles on our "view and print" pages - i've added comments to detail what each workaround does:
We're also considering applying the following overrides to the
For a It's possible that having more control over the key/value widths of the |
In addition to the above comment, we are now releasing the additional overrides to the summary list component for printing in the HMRC PAYE service:
We consulted with our business owners and they confirmed that changing the column widths provided preferable styling for printing |
I have also received reports from a team on the X-GOV slack that our print styles have increased the amount of pages that are now printed out. |
I'm plugging Design System into GOV.UK Notify at the moment. The majority of our pages contain form controls (which will soon use components) so this would benefit us as well. |
As raised by a user on Slack, the lack of print styles means that the panel component prints with light grey text on white: I believe this is the browser’s ‘best effort’ to make it printable – by default, browsers will remove background colours from things when printing them, and because the text would then be white-on-white it’s making the text grey. |
Further to the issue mentioned by 36degrees on 21 Apr. That's quite a low contrast. Has it passed a test for accessibility at A or AA? If not, we'll have to stop using it. |
I'm delighted with what's been done relating to contrast of panel text when printed. I'd like to raise a couple of other issues:
|
Use of sans serif font in print stylesSans serif font is set as default in print stylesheets to avoid issues that occur when printing on some operating systems and print drivers. These issues were impossible to diagnose so the decision was made to leave it to the local fonts on the computers as they’re most likely to work. |
Would you be up for me working on this as a contribution? |
Thanks for the offer @NickColley! We're slightly concerned that this might turn out to be quite a lot of work, especially for our designers who would likely need to be involved in reviewing the changes. However, we'd be happy to trial something if we can keep the scope small, perhaps focusing on a single component to start with? What do you think? |
When simulating print mode on components most don't have the necessary adjustments.
Edit:
Spike that was done: https://github.com/alphagov/govuk-frontend/compare/spike-print-styles
The text was updated successfully, but these errors were encountered: