File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -84,6 +84,21 @@ export function SidebarCollapseProvider({
8484 setMobileNavOpen ( false )
8585 } , [ asPath ] )
8686
87+ // Growing the viewport to the desktop (xxl) layout takes over from the inline
88+ // mobile nav and hides its toggle, so close the mobile nav when we cross the
89+ // breakpoint — otherwise its open state stays stuck and keeps the content
90+ // column hidden. 1400px mirrors breakpoint-xxl.scss.
91+ useEffect ( ( ) => {
92+ if ( typeof window === 'undefined' || ! window . matchMedia ) return
93+ const mql = window . matchMedia ( '(min-width: 1400px)' )
94+ const handle = ( e : MediaQueryListEvent | MediaQueryList ) => {
95+ if ( e . matches ) setMobileNavOpen ( false )
96+ }
97+ handle ( mql ) // close immediately if already at/above xxl on mount
98+ mql . addEventListener ( 'change' , handle )
99+ return ( ) => mql . removeEventListener ( 'change' , handle )
100+ } , [ ] )
101+
87102 const value = useMemo (
88103 ( ) => ( {
89104 collapsed,
Original file line number Diff line number Diff line change 1111}
1212
1313// When the mobile nav is expanded inline, the rail spans the full width and
14- // flows in the page (no fixed height / sticky) below the xxl breakpoint.
14+ // flows in the page (no fixed height / sticky) below the xxl breakpoint. At xxl
15+ // the desktop rail takes over, so revert to the fixed rail width even if the
16+ // mobile-open state is momentarily still set (e.g. mid-resize) — otherwise the
17+ // full-width rail covers the article content.
1518.sidebarFullMobileOpen {
1619 width : 100% ;
20+
21+ @include breakpoint-xxl {
22+ width : 326px ;
23+ }
1724}
1825
1926.sidebarContentFull {
You can’t perform that action at this time.
0 commit comments