@@ -18,8 +18,8 @@ const mouse = {
1818 leave : () => (show_text .value = false ),
1919};
2020
21- const in_view: Ref <number | null > = ref (null );
22- const sl: ScrollListener = new ScrollListener (in_view );
21+ const in_view: Ref <number > = ref (- 1 );
22+ const sl = new ScrollListener (in_view );
2323
2424const registerScrollListener = () => {
2525 sl .reset ();
@@ -42,6 +42,7 @@ onMounted(registerScrollListener);
4242 :key =" $route.path"
4343 @mouseenter =" mouse.enter"
4444 @mouseleave =" mouse.leave"
45+ :style =" { '--z-index': show_text ? 1001 : 0 }"
4546 >
4647 <!-- https://cn.vuejs.org/guide/built-ins/transition.html#javascript-hooks -->
4748 <Transition name =" bars" >
@@ -62,7 +63,7 @@ onMounted(registerScrollListener);
6263 <RightBarDetail
6364 class =" root"
6465 :item =" item"
65- :in_view =" in_view! "
66+ :in_view =" in_view"
6667 :class =" {
6768 expand:
6869 item.children.length &&
@@ -79,7 +80,7 @@ onMounted(registerScrollListener);
7980 v-for =" child in item.children"
8081 class =" sub"
8182 :item =" child"
82- :in_view =" in_view! "
83+ :in_view =" in_view"
8384 :key =" child.index"
8485 />
8586 </div >
@@ -113,6 +114,7 @@ $bar-padding = 4px;
113114$indicator-margin = 4px ;
114115
115116#right
117+ scheme (-- background-color , alpha ($background-light , 90% ), alpha ($background-dark , 90% ));
116118 scheme (-- detail-color , lighten ($text-color , 10% ), $text-color-d );
117119 scheme (-- detail-color-passed , lighten ($text-color , 55% ), darken ($text-color-d , 50% ));
118120 scheme (-- bar-background-color , lighten (black , 88% ), lighten (black , 28% ));
@@ -122,7 +124,7 @@ $indicator-margin = 4px;
122124 width : $width ;
123125 height : $height ;
124126 top : $offset-top ;
125- z-index : 100 ;
127+ z-index : var ( -- z-index ) ;
126128
127129 // To avoid scrollbar flickering
128130 left : "calc(100vw - %s)" % ($offset-right + $width );
@@ -137,6 +139,8 @@ $indicator-margin = 4px;
137139 right : 0 ;
138140 padding : $toc-padding ;
139141 margin : $toc-margin ;
142+ background-color : var (-- background-color );
143+ border-radius : 4px ;
140144
141145 // To avoid flickering on hovering edges
142146 margin-right : $toc-translate-offset ;
0 commit comments