File tree Expand file tree Collapse file tree 4 files changed +19
-11
lines changed Expand file tree Collapse file tree 4 files changed +19
-11
lines changed Original file line number Diff line number Diff line change 1
1
export { Head } from '@unhead/react' ;
2
- export { createPortal , flushSync } from 'react-dom' ;
3
2
export * from 'react-router-dom' ;
4
3
export { Content } from './Content' ;
5
4
export { useActiveMatcher } from './hooks/useActiveMatcher' ;
Original file line number Diff line number Diff line change 37
37
z-index : var (--rp-z-index-mask );
38
38
backdrop-filter : blur (3px );
39
39
background-color : color-mix (in srgb , var (--rp-c-bg ) 60% , transparent );
40
+ display : none ;
41
+ @media (max-width : 767px ) {
42
+ display : block ;
43
+ }
40
44
}
41
45
}
Original file line number Diff line number Diff line change 1
1
import { useLocaleSiteData , useLocation , useSite } from '@rspress/runtime' ;
2
2
import MenuIcon from '@theme-assets/menu' ;
3
3
import { forwardRef , useEffect , useRef } from 'react' ;
4
+ import { createPortal } from 'react-dom' ;
4
5
import { useUISwitch } from '../../layout/Layout/useUISwitch' ;
5
6
import { ReadPercent } from '../ReadPercent' ;
6
7
import { SvgWrapper } from '../SvgWrapper' ;
@@ -112,9 +113,11 @@ export const SidebarMenu = forwardRef(
112
113
</ button >
113
114
) }
114
115
</ div >
115
- { ( isSidebarOpen || isAsideOpen ) && (
116
- < div onClick = { closeSidebar } className = "rp-sidebar-menu__mask" />
117
- ) }
116
+ { ( isSidebarOpen || isAsideOpen ) &&
117
+ createPortal (
118
+ < div onClick = { closeSidebar } className = "rp-sidebar-menu__mask" /> ,
119
+ document . getElementById ( '__rspress_modal_container' ) ! ,
120
+ ) }
118
121
</ >
119
122
) ;
120
123
} ,
Original file line number Diff line number Diff line change 1
1
:root {
2
2
// z-index
3
- --rp-z-index-nav-screen : 80 ;
4
- --rp-z-index-nav-menu : 30 ;
5
- --rp-z-index-nav : 50 ;
6
- --rp-z-index-mask : 70 ;
7
- --rp-z-index-sidebar : 60 ;
3
+ --rp-z-index-nav-screen : 70 ;
4
+ --rp-z-index-nav : 60 ;
5
+ --rp-z-index-mask : 20 ;
6
+ --rp-z-index-sidebar : 50 ;
7
+ --rp-z-index-sidebar-menu : 30 ;
8
8
--rp-z-index-aside : 40 ;
9
9
}
10
10
90
90
91
91
position : sticky ;
92
92
top : var (--rp-nav-height );
93
+ margin-top : var (--rp-sidebar-menu-height );
93
94
right : 0 ;
94
95
z-index : var (--rp-z-index-aside );
95
-
96
96
padding-top : var (--rp-content-padding-y );
97
97
98
98
overflow : hidden scroll ;
99
99
scrollbar-width : none ;
100
100
max-height : calc (100vh - var (--rp-nav-height ));
101
+
102
+ box-shadow : var (--rp-shadow-1 );
101
103
}
102
104
& __menu {
103
105
position : sticky ;
104
106
top : var (--rp-nav-height );
105
107
left : 0 ;
106
- z-index : var (--rp-z-index-nav -menu );
108
+ z-index : var (--rp-z-index-sidebar -menu );
107
109
108
110
height : var (--rp-sidebar-menu-height );
109
111
& __placeholder {
You can’t perform that action at this time.
0 commit comments