From 9c0510918112eebda883b17e5a96058f49ecfd3f Mon Sep 17 00:00:00 2001 From: Cell <1024@lruihao.cn> Date: Thu, 20 Nov 2025 12:53:34 +0800 Subject: [PATCH] fix: adjust margins and widths in TOC styles for better layout --- assets/css/_partials/_single/_toc.scss | 18 +++++++++--------- layouts/_partials/init/index.html | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/assets/css/_partials/_single/_toc.scss b/assets/css/_partials/_single/_toc.scss index 55be0547..0eaacb55 100644 --- a/assets/css/_partials/_single/_toc.scss +++ b/assets/css/_partials/_single/_toc.scss @@ -14,6 +14,7 @@ } ul { + margin: 0; text-indent: -0.8em; padding-left: 0.8em; list-style: none; @@ -166,10 +167,6 @@ display: block; } - > nav > ul { - margin: 0; - } - // for unordered list automatically collapsed ul { ul { @@ -219,7 +216,6 @@ > nav { > ul { - margin: 0; padding: 0.4em 1em 0.4em 1.8em; a:hover { @@ -236,7 +232,6 @@ } > ol { - margin: 0; padding: 0.4em 1em 0.4em 2.25em; li:has(> a:hover)::marker, @@ -270,7 +265,7 @@ opacity 0.2s 0.4s; opacity: 0; translate: 100vw 0; - width: MIN(calc(100% - 4rem), 500px); + width: MIN(100%, 500px); height: 100%; max-width: 100%; max-height: 100%; @@ -279,7 +274,7 @@ .toc { max-width: 100%; - margin-inline: 1rem; + margin-inline: 1rem 5rem; .toc-title { font-size: $toc-title-font-size * 1.5; @@ -289,6 +284,11 @@ .toc-content { font-size: max($toc-content-font-size, 1rem); + + nav { + max-height: calc(100vh - 5rem); + overflow: auto; + } } } @@ -311,7 +311,7 @@ } &[open] { - translate: 0 0; + translate: 4rem 0; } @starting-style { diff --git a/layouts/_partials/init/index.html b/layouts/_partials/init/index.html index e7c87b96..19f11b5f 100644 --- a/layouts/_partials/init/index.html +++ b/layouts/_partials/init/index.html @@ -1,4 +1,4 @@ -{{- hugo.Store.Set "version" "v0.4.0-alpha.3-20251119085609-237c2f3d" -}} +{{- hugo.Store.Set "version" "v0.4.0-alpha.3-20251120045335-afc8c075" -}} {{- .Store.Set "this" dict -}} {{- partial "init/detection-env.html" . -}}