From 54c9fef5094f8a7257565266a1f6443a527b8c01 Mon Sep 17 00:00:00 2001 From: Niels van Brakel Date: Thu, 16 Dec 2021 15:26:19 +0100 Subject: [PATCH] made new css var for the article width --- assets/css/common/main.css | 4 ++++ assets/css/core/theme-vars.css | 1 + layouts/_default/baseof.html | 2 +- layouts/partials/toc.html | 2 +- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/assets/css/common/main.css b/assets/css/common/main.css index 50022ac..f6c5145 100644 --- a/assets/css/common/main.css +++ b/assets/css/common/main.css @@ -6,6 +6,10 @@ padding: var(--gap); } +.main.page { + max-width: calc(var(--article-width) + var(--gap) * 2); +} + .page-header h1 { font-size: 40px; } diff --git a/assets/css/core/theme-vars.css b/assets/css/core/theme-vars.css index 75d52a7..bb1bd99 100644 --- a/assets/css/core/theme-vars.css +++ b/assets/css/core/theme-vars.css @@ -3,6 +3,7 @@ --content-gap: 20px; --nav-width: 1380px; --main-width: 720px; + --article-width: 650px; --toc-width: 300px; --header-height: 60px; --footer-height: 60px; diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 6dfe741..38d6319 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -14,7 +14,7 @@ {{- end -}} " id="top"> {{- partialCached "header.html" . .Page -}} -
+
{{- block "main" . }}{{ end }}
{{ partialCached "footer.html" . .Layout .Kind (.Param "hideFooter") (.Param "ShowCodeCopyButtons") -}} diff --git a/layouts/partials/toc.html b/layouts/partials/toc.html index 0d2ed25..17e8af2 100644 --- a/layouts/partials/toc.html +++ b/layouts/partials/toc.html @@ -126,7 +126,7 @@ }) }, false); - const main = parseInt(getComputedStyle(document.body).getPropertyValue('--main-width'), 10); + const main = parseInt(getComputedStyle(document.body).getPropertyValue('--article-width'), 10); const toc = parseInt(getComputedStyle(document.body).getPropertyValue('--toc-width'), 10); const gap = parseInt(getComputedStyle(document.body).getPropertyValue('--gap'), 10);