alphagov / govuk_frontend_alpha

This repository will be archived.
MIT License
61 stars 13 forks source link

Plan for print styles #62

Open gemmaleigh opened 7 years ago

gemmaleigh commented 7 years ago

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:

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.

robinwhittleton commented 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.

selfthinker commented 7 years ago

I have done it the way @robinwhittleton describes for a couple of years now. I generally like that approach. I encountered two downsides: