Skip to content

Commit

Permalink
Add display override for hiding content when printing
Browse files Browse the repository at this point in the history
When printing users often need to print the content without the surrounding site furniture (eg menus, breadcrumbs, back links and footers).

Introduce a helper so that a class can be used to hide any given element from the print view.

This is explicit and preferable to listing all the selectors for things that shouldn't be printed. These lists grow unwieldy over time.
  • Loading branch information
fofr committed Feb 10, 2020
1 parent 1d2fcb6 commit c6f2972
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@

### New features

#### Add display override for hiding content when printing

Introduce a CSS class that can be used to hide any given element from the print view: `govuk-!-print-display-none`

[Pull request #1723: Add display override for hiding content when printing](https://github.com/alphagov/govuk-frontend/pull/1723).

### Fixes

## 3.5.0 (Feature release)
Expand Down
6 changes: 6 additions & 0 deletions src/govuk/overrides/_display.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,10 @@
.govuk-\!-display-none {
display: none !important;
}

@include govuk-media-query($media-type: print) {
.govuk-\!-print-display-none {
display: none !important;
}
}
}

0 comments on commit c6f2972

Please sign in to comment.