From 9ab964cf85cca4bf5be08450434e1a33a51dcfa7 Mon Sep 17 00:00:00 2001 From: zinefer Date: Mon, 4 Aug 2025 11:48:14 -0600 Subject: [PATCH 1/3] Stylefix: Use theme colors for code,pre --- static/css/type.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/css/type.css b/static/css/type.css index 73c58fd..3b09fc5 100644 --- a/static/css/type.css +++ b/static/css/type.css @@ -73,8 +73,8 @@ li { /* Code */ code, pre { font-family: 'Fira Code', 'Consolas', 'Monaco', monospace; - color: #FF4F00; - background-color: #6e6e6e; + color: var(--text-color); + background-color: var(--form-input-background-color); padding: 0.2em 0.4em; border-radius: 3px; } From 9b578611c90415fa016c418e23f4a3ba5944e342 Mon Sep 17 00:00:00 2001 From: zinefer Date: Tue, 23 Sep 2025 22:48:21 -0600 Subject: [PATCH 2/3] Init print button --- layouts/_default/single.html | 3 ++ layouts/partials/head.html | 3 +- layouts/shortcodes/printbreak.html | 1 + static/css/print.css | 60 ++++++++++++++++++++++++++++++ static/css/style.css | 22 +++++++++++ 5 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 layouts/shortcodes/printbreak.html create mode 100644 static/css/print.css diff --git a/layouts/_default/single.html b/layouts/_default/single.html index fb9cece..597003d 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -8,6 +8,9 @@
{{ partial "sidebar.html" . }}
+
+ Print +
{{ .Content }}
{{ partial "overview.html" . }} diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 27ce5f5..e43a429 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -9,4 +9,5 @@ - \ No newline at end of file + + \ No newline at end of file diff --git a/layouts/shortcodes/printbreak.html b/layouts/shortcodes/printbreak.html new file mode 100644 index 0000000..4487031 --- /dev/null +++ b/layouts/shortcodes/printbreak.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/css/print.css b/static/css/print.css new file mode 100644 index 0000000..a341973 --- /dev/null +++ b/static/css/print.css @@ -0,0 +1,60 @@ +/* Print stylesheet: hide navigation and force black-on-white for readable prints */ + +/* Ensure page prints using full width for content */ +@page { + margin: 20mm; +} + +/* Hide site chrome */ +header.site-header, +.sidebar, +.content-overview { + display: none !important; +} + +/* Allow content to use full page width */ +.content { + display: block !important; + width: auto !important; + padding: 0 !important; + margin: 20mm !important; + overflow: visible !important; + position: static !important; + color: #000 !important; + background: #fff !important; +} + +/* Neutralize colors and backgrounds inside content */ +.content * { + color: #000 !important; + background: transparent !important; + -webkit-print-color-adjust: exact !important; + print-color-adjust: exact !important; +} + +/* Make images scale nicely */ +.content img { + max-width: 100% !important; + height: auto !important; +} + +/* Remove any shadows, borders that might not print well */ +* { + box-shadow: none !important; + text-shadow: none !important; + border: none !important; +} + +/* Hide the print button itself when printing */ +.print-link, +.content-actions { + display: none !important; +} + +printbreak { + display: block; + width: 100%; + height: 1px; + page-break-after: always; + break-before: always; +} diff --git a/static/css/style.css b/static/css/style.css index 9161f55..602e3ce 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -221,6 +221,7 @@ th { padding: 2rem; overflow-y: auto; scroll-behavior: smooth; + position: relative; a { color: var(--brand-color); } @@ -237,6 +238,27 @@ th { } } +.content-actions { + position: absolute; + top: 1rem; + right: 1rem; + pointer-events: auto; +} + +.print-link { + background: var(--brand-color); + color: #fff !important; + padding: 0.35rem 0.6rem; + border-radius: 4px; + text-decoration: none !important; + font-weight: 600; + box-shadow: 0 1px 0 rgba(0,0,0,0.2); +} + +.print-link:hover { + opacity: 0.95; +} + .content-overview { min-width: 250px; background-color: var(--content-overview-background-color); From c8f8d985bf924f9277a7b6c64ea89dc071d94f63 Mon Sep 17 00:00:00 2001 From: zinefer Date: Tue, 23 Sep 2025 22:59:41 -0600 Subject: [PATCH 3/3] Fix button style --- static/css/style.css | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/static/css/style.css b/static/css/style.css index 602e3ce..5492d04 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -246,8 +246,7 @@ th { } .print-link { - background: var(--brand-color); - color: #fff !important; + border: 1px solid var(--brand-color); padding: 0.35rem 0.6rem; border-radius: 4px; text-decoration: none !important;