Skip to content
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

Open
NickColley opened this issue Mar 5, 2018 · 15 comments
Open

Add print styles to components #573

NickColley opened this issue Mar 5, 2018 · 15 comments
Labels
design epic Epics are used in planning project boards to group related stories feature request User requests a new feature sass / css

Comments

@NickColley
Copy link
Contributor

NickColley commented Mar 5, 2018

When simulating print mode on components most don't have the necessary adjustments.

screen shot 2018-03-05 at 13 53 50

Edit:
Spike that was done: https://github.com/alphagov/govuk-frontend/compare/spike-print-styles

@NickColley NickColley changed the title Components need print mode Review print mode for components May 29, 2018
@NickColley NickColley added 1.0.0 and removed context labels May 30, 2018
@NickColley NickColley removed the 1.0.0 label Jun 7, 2018
@NickColley
Copy link
Contributor Author

@36degrees I think our users such as GOV.UK Publishing will run into this pretty soon.

@36degrees 36degrees added spike and removed high labels Jul 30, 2018
@kr8n3r
Copy link

kr8n3r commented Sep 16, 2018

@NickColley NickColley removed the spike label Sep 25, 2018
@NickColley NickColley added the feature request User requests a new feature label Jan 8, 2019
@andysellick
Copy link
Contributor

I'm currently looking at print stylesheets for components using GOV.UK Frontend on GOV.UK, so this would be great 👍

@NickColley NickColley changed the title Review print mode for components Add print stylesheets to components Jan 23, 2019
@NickColley NickColley added the awaiting triage Needs triaging by team label Jan 23, 2019
@injms
Copy link
Contributor

injms commented Jan 23, 2019

✋ me too - I've put together something to make the accordion component readable when printed out, but it's got some not-so-nice !importants.

@kellylee-gds kellylee-gds added Priority: Low and removed awaiting triage Needs triaging by team labels Jan 30, 2019
@frankieroberto
Copy link
Contributor

👍 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).

@crosslandwa
Copy link

crosslandwa commented May 31, 2019

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):

Page screenshot:
p11db-govuk-print-screenshot

Printing in chrome:
p11d-print-screenshot

We've provided a form for users to provide feedback, and had several comments about printing. Here are some quotes:

  • Can you make reports printer friendly please. The large bold letters are using plenty of ink!
  • The plld forms printing option put them altogether and each employer should be on a different page to make it easy to print off for each employee withe payment amount on separate page for employer information. Very clunky and not very user friendly
  • The print option for P11d etc does not work properly - you get everything, including the web page headings and even the print button! Please can we print just the forms.
  • It would be great to get a really easy print out of the previous year - on one page too (it's enormously wasteful of paper).
  • P11D forms are not in a fit format to give to employees.
  • The printed P11D looks very amateurish to give employees when they've been used to an 'official looking' P11D in the past.

(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:

@media print {
  /* hide GOV UK components */
  .govuk-phase-banner, .govuk-footer, .govuk-button, .govuk-header__content {
    display: none;
  }

  /* hide relative links - gov uk print styles only look to hide http/https links */
  .govuk-link[href]:after {
    content: none;
  }

  /* hide bespoke language switcher component */
  .portal-rsa-language-switcher {
    display: none;
  }

  /* forces printing at A3 size, so that desktop rather than mobile layout is used */
  @page {
    size: 297mm 420mm;
    margin: 18mm;
  }
}

We're also considering applying the following overrides to the summary-list component:

@media print {
  .govuk-summary-list__key {
    width: 70% !important;
    padding-bottom: 0 !important;
  }

  .govuk-summary-list__value {
    width: 30% !important;
    padding-bottom: 0 !important;
  }
}

For a summary-list with a single "column" of values, fixing the govuk-summary-list__key width at 30% causes the table to take more vertical space then it could when printing:
Screen Shot 2019-05-31 at 14 33 19

It's possible that having more control over the key/value widths of the summary-list component would help us here (rather than having specific print styles...)

@KB55
Copy link

KB55 commented Jun 6, 2019

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:

 @media print {
  .govuk-summary-list__key {
    width: 70% !important;
    padding-bottom: 0 !important;
  }

  .govuk-summary-list__value {
    width: 30% !important;
    padding-bottom: 0 !important;
  }
}

We consulted with our business owners and they confirmed that changing the column widths provided preferable styling for printing

@NickColley
Copy link
Contributor Author

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.

@tombye
Copy link

tombye commented Oct 16, 2019

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.

@36degrees
Copy link
Contributor

As raised by a user on Slack, the lack of print styles means that the panel component prints with light grey text on white:

image

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.

@vanitabarrett vanitabarrett added the awaiting triage Needs triaging by team label Aug 27, 2020
@trang-erskine trang-erskine removed the awaiting triage Needs triaging by team label Sep 7, 2020
@terrysimpson99
Copy link

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.

@terrysimpson99
Copy link

terrysimpson99 commented Sep 8, 2020

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:

  1. Please can body text default to 14 point (in the printed paper version)? I think the current default is 12 point. We increased it from 12 to 14 point to reduce requests for large print or other assistance in accordance with https://www.gov.uk/government/publications/inclusive-communication/accessible-communication-formats and https://www.rnib.org.uk/sites/default/files/Top_Tips_Creating_accessible_print_documents.pdf

  2. Please can the vertical space used by the panel be reduced (in the printed paper version)? We sometimes have content in addition the panel and our users end up printing more than one page. A panel that consumes less vertical space will reduce the number of pages that get printed.

@CharlotteDowns
Copy link
Contributor

Use of sans serif font in print styles

Sans 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.

@36degrees 36degrees changed the title Add print stylesheets to components Add print styles to components Feb 2, 2021
@trang-erskine trang-erskine added epic Epics are used in planning project boards to group related stories 🕔 weeks and removed 🕔 days labels Oct 27, 2021
@NickColley
Copy link
Contributor Author

Would you be up for me working on this as a contribution?

@36degrees
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design epic Epics are used in planning project boards to group related stories feature request User requests a new feature sass / css
Projects
None yet
Development

No branches or pull requests