2024-02-05 18:01:50 +08:00
|
|
|
.widget-wrapper.toc
|
|
|
|
background: var(--site-bg)
|
|
|
|
z-index 1
|
2024-02-06 23:39:51 +08:00
|
|
|
.widget-body
|
|
|
|
position relative
|
|
|
|
&:before
|
|
|
|
content: ''
|
|
|
|
position absolute
|
|
|
|
top: 4px
|
|
|
|
bottom: 4px
|
|
|
|
left: 0
|
|
|
|
width: 4px
|
|
|
|
background: var(--block)
|
|
|
|
border-radius: 4px
|
2024-02-05 22:55:10 +08:00
|
|
|
|
2024-02-05 10:03:55 +08:00
|
|
|
// 目录基本样式
|
|
|
|
.widget-wrapper.toc .toc
|
|
|
|
--fsp: $fsp2
|
|
|
|
padding: 0
|
|
|
|
margin: 0
|
|
|
|
position relative
|
|
|
|
list-style: none
|
|
|
|
li
|
2024-02-06 23:39:51 +08:00
|
|
|
margin: 0
|
2024-02-05 10:03:55 +08:00
|
|
|
list-style: none
|
2024-02-06 23:39:51 +08:00
|
|
|
a
|
|
|
|
--padding: calc(var(--gap-padding) / 2)
|
|
|
|
--padding-offset: calc(0 - var(--padding))
|
|
|
|
padding: 6px var(--padding)
|
|
|
|
margin: 0 var(--padding)
|
2024-02-05 22:55:10 +08:00
|
|
|
color: var(--text-p3)
|
2024-02-05 10:03:55 +08:00
|
|
|
display: block
|
|
|
|
position relative
|
2024-02-06 23:39:51 +08:00
|
|
|
border-radius: $border-bar
|
|
|
|
trans1 all
|
|
|
|
&.active:before
|
|
|
|
content: ''
|
|
|
|
position absolute
|
|
|
|
top: 4px
|
|
|
|
bottom: 4px
|
|
|
|
left: -8px
|
|
|
|
width: 4px
|
2024-02-05 10:03:55 +08:00
|
|
|
background: $color-theme
|
2024-02-06 23:39:51 +08:00
|
|
|
border-radius: 4px
|
|
|
|
&:hover
|
|
|
|
background: var(--block-hover)
|
|
|
|
color: var(--text)
|
2024-02-05 10:03:55 +08:00
|
|
|
|
|
|
|
// 固定位置
|
2024-02-05 18:01:50 +08:00
|
|
|
.l_right .widgets .widget-wrapper.toc
|
2024-02-06 23:39:51 +08:00
|
|
|
margin-top: 0
|
2024-02-05 10:03:55 +08:00
|
|
|
position: sticky
|
|
|
|
position: -webkit-sticky
|
2024-02-05 18:01:50 +08:00
|
|
|
top: 0
|
|
|
|
padding: 16px 0
|
2024-02-06 23:39:51 +08:00
|
|
|
&:first-child
|
|
|
|
top: 8px
|
|
|
|
padding-top: 8px
|
2024-02-05 18:01:50 +08:00
|
|
|
.widget-body .toc
|
2024-02-05 22:55:10 +08:00
|
|
|
max-height: 70vh
|
2024-02-05 18:01:50 +08:00
|
|
|
@media screen and (max-width: $device-laptop)
|
|
|
|
max-height: unset
|
2024-02-05 19:49:33 +08:00
|
|
|
overflow: auto
|
2024-02-05 22:55:10 +08:00
|
|
|
scrollbar(0, 0)
|
2024-02-05 18:01:50 +08:00
|
|
|
|
|
|
|
|
2024-02-05 10:03:55 +08:00
|
|
|
|
|
|
|
// 各级缩进样式
|
|
|
|
.widget-wrapper.toc .toc
|
|
|
|
.toc-item
|
|
|
|
font-weight: 500
|
|
|
|
--fsp: $fsp1
|
2024-02-06 23:39:51 +08:00
|
|
|
.toc-item .toc-item
|
2024-02-05 10:03:55 +08:00
|
|
|
font-weight: 400
|
|
|
|
--fsp: $fsp2
|
2024-02-06 23:39:51 +08:00
|
|
|
ol
|
|
|
|
padding-left: 0
|
|
|
|
.toc-child .toc-link
|
|
|
|
padding-left: 1.5rem
|
|
|
|
.toc-child .toc-child .toc-link
|
|
|
|
padding-left: 2.5rem
|
|
|
|
.toc-child .toc-child .toc-child .toc-link
|
|
|
|
padding-left: 3.5rem
|
|
|
|
.toc-child .toc-child .toc-child .toc-child .toc-link
|
|
|
|
padding-left: 4.5rem
|
|
|
|
.toc-child .toc-child .toc-child .toc-child .toc-child .toc-link
|
|
|
|
padding-left: 5rem
|
2024-02-05 10:03:55 +08:00
|
|
|
|
|
|
|
// 高亮样式
|
|
|
|
.widget-wrapper.toc .toc a.toc-link.active
|
2024-02-05 22:55:10 +08:00
|
|
|
color: var(--text)
|
2024-02-05 10:03:55 +08:00
|
|
|
&:before,&:after
|
|
|
|
content: ''
|
|
|
|
|
|
|
|
// 始终折叠
|
|
|
|
.widget-wrapper.toc[collapse='true']
|
|
|
|
.toc-item a.toc-link+ol
|
|
|
|
display: none
|
|
|
|
// 激活上级目录时显示子目录
|
|
|
|
.toc a.toc-link.active+ol
|
|
|
|
display: block
|
|
|
|
|
|
|
|
// 自动折叠
|
|
|
|
.widget-wrapper.toc[collapse='auto']
|
|
|
|
.toc-item a.toc-link+ol
|
|
|
|
display: none
|
|
|
|
// 激活上级目录时显示子目录
|
|
|
|
.toc a.toc-link.active+ol
|
|
|
|
display: block
|
|
|
|
// 鼠标放上去时显示子目录
|
|
|
|
&:hover a.toc-link+ol
|
|
|
|
display: block
|
|
|
|
|
|
|
|
// 子目录激活时显示
|
|
|
|
.widget-wrapper.toc[collapse='true'] ol:has(> .toc-item a.active)
|
|
|
|
display: block
|
|
|
|
.widget-wrapper.toc[collapse='auto'] ol:has(> .toc-item a.active)
|
2024-02-05 18:01:50 +08:00
|
|
|
display: block
|
|
|
|
|
|
|
|
// 手动折叠
|
|
|
|
.widget-wrapper.toc
|
|
|
|
.widget-body
|
|
|
|
display: grid
|
|
|
|
grid-template-rows: 1fr
|
|
|
|
trans1 all
|
|
|
|
overflow hidden
|
|
|
|
.l_right .widgets .widget-wrapper.toc .widget-header .cap-action:hover
|
|
|
|
background: var(--block-border)
|
|
|
|
.l_right .widgets .widget-wrapper.toc.collapse
|
|
|
|
.widget-header .cap-action
|
|
|
|
background: var(--block-border)
|
|
|
|
.widget-body
|
|
|
|
grid-template-rows: 0fr
|
|
|
|
|
|
|
|
// 编辑本文按钮
|
2024-02-05 22:55:10 +08:00
|
|
|
.widget-wrapper.toc .widget-body+.widget-footer:before
|
|
|
|
content: ''
|
|
|
|
position absolute
|
|
|
|
background: var(--block-border)
|
|
|
|
top: 0
|
|
|
|
height: 1px
|
2024-02-06 23:39:51 +08:00
|
|
|
left: var(--gap-padding)
|
|
|
|
right: var(--gap-padding)
|
2024-02-05 18:01:50 +08:00
|
|
|
.widget-wrapper.toc .widget-footer
|
|
|
|
margin-top: 8px
|
|
|
|
color: var(--text-p2)
|
|
|
|
position relative
|
|
|
|
padding-top: 8px
|
|
|
|
a
|
|
|
|
display: flex
|
|
|
|
align-items: center
|
|
|
|
color: inherit
|
|
|
|
font-size: $fs-14
|
2024-02-06 23:39:51 +08:00
|
|
|
padding: 8px var(--gap-padding)
|
|
|
|
border-radius: $border-bar
|
|
|
|
trans1 all
|
2024-02-05 18:01:50 +08:00
|
|
|
svg,img
|
|
|
|
height: 16px
|
|
|
|
width: auto
|
|
|
|
margin-right: 8px
|
|
|
|
a:hover
|
2024-02-05 22:55:10 +08:00
|
|
|
background: var(--block-hover)
|
|
|
|
color: var(--text)
|
|
|
|
|
|
|
|
.widget-wrapper.toc+.widget-wrapper
|
|
|
|
padding-top: 32px
|
|
|
|
|
|
|
|
@media screen and (max-width: $device-laptop)
|
|
|
|
.l_right
|
|
|
|
blur-effect()
|
|
|
|
.widgets
|
|
|
|
.widget-wrapper.toc
|
2024-02-06 23:39:51 +08:00
|
|
|
position: static
|
|
|
|
background: none
|
2024-02-05 22:55:10 +08:00
|
|
|
.widget-wrapper.toc .toc
|
|
|
|
a
|
|
|
|
color: var(--text-p2)
|
|
|
|
.widget-wrapper.toc .widget-footer
|
|
|
|
a
|
2024-02-06 23:39:51 +08:00
|
|
|
background: var(--alpha100)
|
2024-02-05 22:55:10 +08:00
|
|
|
a+a
|
|
|
|
margin-top: 4px
|