From 494780c74cd25d3001ce94973534ecfed6cf06e7 Mon Sep 17 00:00:00 2001 From: danix Date: Sun, 5 Mar 2023 08:34:55 +0100 Subject: [PATCH] initial styling of the print stylesheet. Needs working. --- assets/sass/print.scss | 72 ++++++++++++++++++++++++++++++++++++++ layouts/partials/head.html | 12 +++++-- 2 files changed, 81 insertions(+), 3 deletions(-) create mode 100644 assets/sass/print.scss diff --git a/assets/sass/print.scss b/assets/sass/print.scss new file mode 100644 index 0000000..f625709 --- /dev/null +++ b/assets/sass/print.scss @@ -0,0 +1,72 @@ +@import 'libs/vars'; +@import 'libs/functions'; +@import 'libs/my-mixins'; + +body { + margin: 0; + padding: 0; + font: 12pt Georgia, "Times New Roman", Times, serif; + line-height: 1.3; + background: #fff !important; + color: #000; +} +#wrapper { + width: 100%; + margin: 0; + float: none; +} +figure.image { + &.shadow { + img { + box-shadow: none; + } + } + figcaption { + @include hide-visually; + } +} +header#header, +#backtotop, +footer#footer { + @include hide-visually; +} +div#main { + margin-left: 2cm; + margin-right: 1cm; +} +H3#danilo-macrì { + font-size: 24pt; +} +h2, h3, h4 { + font-size: 14pt; +} +/* Defining all page breaks */ +a { + page-break-inside:avoid +} +blockquote { + page-break-inside: avoid; +} +h1, h2, h3, h4, h5, h6 { + page-break-after:avoid; + page-break-inside:avoid + } +img { + page-break-inside:avoid; + page-break-after:avoid; +} +table, pre { + page-break-inside:avoid +} +p, ul, ol, dl { + page-break-before:avoid; + page-break-inside: avoid; +} +div.col-8 { + h4 { + page-break-after: avoid; + } + strong { + page-break-before: avoid; + } +} diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 0f5757b..15c517c 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -4,16 +4,22 @@ - {{ $style_options := (dict "targetPath" "css/style.css" "outputStyle" "compressed" "transpiler" "dartsass" "enableSourceMap" (not hugo.IsProduction)) }} - {{ $style := resources.Get "sass/main.scss" | resources.ToCSS $style_options }} + {{ $style := resources.Get "sass/main.scss" | resources.ToCSS $style_options | fingerprint }} {{ $noscript_options := (dict "targetPath" "css/noscript.css" "outputStyle" "compressed" "transpiler" "dartsass" "enableSourceMap" (not hugo.IsProduction)) }} - {{ $noscript := resources.Get "sass/noscript.scss" | resources.ToCSS $noscript_options }} + {{ $noscript := resources.Get "sass/noscript.scss" | resources.ToCSS $noscript_options | fingerprint }} + + {{ if eq "curriculum" .Type }} + {{ $print_style_options := (dict "targetPath" "css/print.css" "outputStyle" "compressed" "transpiler" "dartsass" "enableSourceMap" (not hugo.IsProduction)) }} + {{ $print_style := resources.Get "sass/print.scss" | resources.ToCSS $print_style_options | fingerprint }} + + {{ end }} + {{ partial "funcs/favicon.html" . }} -- 2.20.1