Open gemmaleigh opened 7 years ago
One possibility we’ve talked about has been to include each component’s print styles inside the component’s SASS instead of having a separate print stylesheet. We could do this using individual @media screen
and @media print
blocks – this is supported in IE6 and up so no browser compatibility considerations. Some prototyping is probably in order.
I have done it the way @robinwhittleton describes for a couple of years now. I generally like that approach. I encountered two downsides:
@extend
or %placehold
across several @media
sections.@media screen
around things. That will be to the detriment of the print experience.
Our current approach to applying styles for print is to use a single print stylesheet.
<link href="{{ asset_path + 'stylesheets/govuk-template-print.css' }}" media="print" rel="stylesheet" />
This print stylesheet imports:
@import "styleguide/print";
The
$is-print
helper is used in the govuk_frontend_toolkit's_typography.scss
by the core-font generator mixin to set a different font family, font-size and line-height for each of the typography mixins.One of the aims of the govuk_frontend_alpha work is to reduce the number of stylesheets that the base template must include.
We should investigate how we will apply global print styles and how to set print styles on a per-component basis, with the assumption that all styles for a component will exist in a single component Sass file, including its print overrides.