diff --git a/opentech/static_src/src/sass/print.scss b/opentech/static_src/src/sass/print.scss new file mode 100644 index 0000000000000000000000000000000000000000..c756a1c168b9a9b83784b3c7317240b2e2ae1626 --- /dev/null +++ b/opentech/static_src/src/sass/print.scss @@ -0,0 +1,102 @@ +// sass-lint:disable no-color-hex, no-color-literals, no-important, no-vendor-prefixes +* { + background: transparent !important; + color: #000 !important; // Black prints faster: h5bp.com/s + box-shadow: none !important; + text-shadow: none !important; + filter: none !important; + -ms-filter: none !important; + font-family: 'Garamond Premier Pro', serif !important; + font-style: normal !important; + letter-spacing: normal !important; + text-align: left !important; +} + +html { + font-size: 100% !important; +} + +@page { + margin: 1cm !important; +} + +body { + font-size: 14px !important; + line-height: 1.3 !important; + margin: 1cm !important; +} + + +// Underline all links. +:link, +:visited { + text-decoration: none !important; + border: 0 !important; + color: #000 !important; +} + +// Add visible URL after links. +a[href^='http:']::after, +a[href^='https:']::after { + content: ' (' attr(href) ')'; +} + +abbr[title] { + // Add visible title after abbreviations. + &::after { + content: ' (' attr(title) ')'; + } +} + +p, +h2, +h3 { + orphans: 3; + widows: 3; +} + +h2, +h3 { + page-break-after: avoid; +} + +.header__logo { + fill: #000; +} + +.header { + height: auto; + padding: 0; + + &::after { + background: transparent !important; + } +} + +.admin-bar { + position: static; + right: auto; + left: auto; + width: auto; + padding: 0; + margin-right: 0; + margin-left: 0; +} + +nav, +aside, +footer, +.icon, +.card__icon, +.header__icon, +.header__menus, +.header__button-container, +.status-bar, +.tabs__container, +.js-actions-toggle, +.js-actions-sidebar, +.link--edit-submission, +.section--share, +.link--fixed-apply { + display: none !important; +} diff --git a/opentech/static_src/src/sass/public/abstracts/_mixins.scss b/opentech/static_src/src/sass/public/abstracts/_mixins.scss index c529ba3495990d53b90b86425db5fcdb41f2c87c..59f09d3338fa80b61bd0c3800d6f9ce1a5041bf1 100644 --- a/opentech/static_src/src/sass/public/abstracts/_mixins.scss +++ b/opentech/static_src/src/sass/public/abstracts/_mixins.scss @@ -6,7 +6,7 @@ $declaration: nth($breakpoint, 2); @if $query == $name and $declaration { - @media only screen and #{$declaration} { + @media #{$declaration} { @content; } } diff --git a/opentech/templates/base-apply.html b/opentech/templates/base-apply.html index 33cf53fd00dd4993a9a880b77a5207525b16a280..2d885f89ccec0dd9c94b9a03a807bab836f0664e 100644 --- a/opentech/templates/base-apply.html +++ b/opentech/templates/base-apply.html @@ -30,6 +30,7 @@ {# Hijack styling #} <link rel="stylesheet" href="{% static 'hijack/hijack-styles.css' %}" /> {% block extra_css %}{% endblock %} + <link rel="stylesheet" href="{% static 'css/print.css' %}" media="print"> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> </head> diff --git a/opentech/templates/base.html b/opentech/templates/base.html index e7c707ee2c2764fa010fb587f28e8a450105a1d8..e4b81750677a877eac14f192aab9286ff84d4668 100644 --- a/opentech/templates/base.html +++ b/opentech/templates/base.html @@ -53,8 +53,8 @@ <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/normalize/8.0.0/normalize.min.css"> <link rel="stylesheet" href="{% static 'css/public/main.css' %}"> - {% block extra_css %}{% endblock %} + <link rel="stylesheet" href="{% static 'css/print.css' %}" media="print"> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> </head>