made new css var for the article width

This commit is contained in:
Niels van Brakel 2021-12-16 15:26:19 +01:00
parent 0a4d7c8e14
commit 54c9fef509
4 changed files with 7 additions and 2 deletions

View File

@ -6,6 +6,10 @@
padding: var(--gap); padding: var(--gap);
} }
.main.page {
max-width: calc(var(--article-width) + var(--gap) * 2);
}
.page-header h1 { .page-header h1 {
font-size: 40px; font-size: 40px;
} }

View File

@ -3,6 +3,7 @@
--content-gap: 20px; --content-gap: 20px;
--nav-width: 1380px; --nav-width: 1380px;
--main-width: 720px; --main-width: 720px;
--article-width: 650px;
--toc-width: 300px; --toc-width: 300px;
--header-height: 60px; --header-height: 60px;
--footer-height: 60px; --footer-height: 60px;

View File

@ -14,7 +14,7 @@
{{- end -}} {{- end -}}
" id="top"> " id="top">
{{- partialCached "header.html" . .Page -}} {{- partialCached "header.html" . .Page -}}
<main class="main"> <main class="main {{- if (eq .Kind `page`) -}}{{- print " page" -}}{{- end -}}">
{{- block "main" . }}{{ end }} {{- block "main" . }}{{ end }}
</main> </main>
{{ partialCached "footer.html" . .Layout .Kind (.Param "hideFooter") (.Param "ShowCodeCopyButtons") -}} {{ partialCached "footer.html" . .Layout .Kind (.Param "hideFooter") (.Param "ShowCodeCopyButtons") -}}

View File

@ -126,7 +126,7 @@
}) })
}, false); }, 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 toc = parseInt(getComputedStyle(document.body).getPropertyValue('--toc-width'), 10);
const gap = parseInt(getComputedStyle(document.body).getPropertyValue('--gap'), 10); const gap = parseInt(getComputedStyle(document.body).getPropertyValue('--gap'), 10);