From c06c8c0e5c8dbba06ad2b98161ce1a7229b28917 Mon Sep 17 00:00:00 2001 From: Tom Byers Date: Thu, 17 Oct 2019 12:07:07 +0100 Subject: [PATCH] Put basic print stylesheet back in Replicates the GOV.UK template one, adjusted for the GOV.UK Frontend template HTML. --- app/assets/stylesheets/print.scss | 85 +++++++++++++++++++++++++++++++ app/templates/admin_template.html | 1 + gulpfile.js | 2 +- 3 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 app/assets/stylesheets/print.scss diff --git a/app/assets/stylesheets/print.scss b/app/assets/stylesheets/print.scss new file mode 100644 index 000000000..88a014faf --- /dev/null +++ b/app/assets/stylesheets/print.scss @@ -0,0 +1,85 @@ +// sass-lint:disable no-important +// set asset URL root to match that of application +$govuk-assets-path: "/static/"; + +@import "settings/all"; +@import "tools/all"; +@import "helpers/all"; + +@import "core/all"; +@import "objects/all"; + +* { + background: transparent; + color: black; + text-shadow: none; + filter: none; + -ms-filter: none; +} + +body { + @include govuk-font($size: 14); + margin: 0; + padding: 0; + width: 100%; +} + +a, +a:visited { + word-wrap: break-word; +} + +a[href^="/"]:after, +a[href^="http://"]:after, +a[href^="https://"]:after { + content: " (" attr(href) ")"; + font-size: 90%; +} + +a[href^="javascript:"]:after, +a[href^="#"]:after { + content: ""; +} + +img { + max-width: 100% !important; +} + +select { + background: white; +} + +.govuk-header { + + .govuk-header__logo { + @include govuk-font($size: 19); + text-rendering: optimizeLegibility; + + a { + &, + &:visited { + text-decoration: none; + } + + &:after { + content: ""; + } + } + + svg { + width: 45px; + height: 40px; + position: relative; + top: -3px; + vertical-align: bottom; + } + } +} + +.govuk-visually-hidden, +.govuk-visually-hidden-focusable, +.notify-cookie-message, +.govuk-skip-link, +.govuk-footer { + display: none !important; +} diff --git a/app/templates/admin_template.html b/app/templates/admin_template.html index c69abfb15..b7d0ada02 100644 --- a/app/templates/admin_template.html +++ b/app/templates/admin_template.html @@ -13,6 +13,7 @@ {% block head %} + diff --git a/gulpfile.js b/gulpfile.js index aeb0b19af..de18f24e2 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -126,7 +126,7 @@ const javascripts = () => { const sass = () => { - return src(paths.src + '/stylesheets/main*.scss') + return src([paths.src + '/stylesheets/main*.scss', paths.src + '/stylesheets/print.scss']) .pipe(plugins.prettyerror()) .pipe(plugins.sass({ outputStyle: 'compressed',