From a0958f13c27da9add310214759156ae236d4015a Mon Sep 17 00:00:00 2001 From: xaoxuu Date: Sun, 24 Dec 2023 15:01:08 +0800 Subject: [PATCH] [opt] toc auto expand --- source/css/_layout/widgets/toc_common.styl | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/source/css/_layout/widgets/toc_common.styl b/source/css/_layout/widgets/toc_common.styl index 5e35eab..fa89baa 100644 --- a/source/css/_layout/widgets/toc_common.styl +++ b/source/css/_layout/widgets/toc_common.styl @@ -24,7 +24,7 @@ padding: 0.5rem font-weight: 500 font-size: $fs-13 - color: var(--text-p2) + color: var(--text-p1) .toc-child .toc-item .toc-link padding: 0.25rem 0.5rem 0.25rem 1.3rem font-weight: 400 @@ -69,3 +69,14 @@ color: $color-theme !important &:before visibility: visible + + +// 激活上级目录时显示子目录 +.toc-item a.toc-link+ol + display: none +.toc a.toc-link.active+ol + display: block +ol:has(> .toc-item a.active) + display: block +.doc-tree:hover a.toc-link+ol + display: block