File tree Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 77
88body {
99 --sidebarWidth : 300px ;
10+ --sidebarMinWidth : 300px ;
1011 --sidebarTransitionDuration : 0.3s ;
1112 background-color : var (--background );
1213 color : var (--textBody );
@@ -23,19 +24,20 @@ body {
2324
2425.main {
2526 display : flex;
26- justify-content : flex-end;
2727 height : 100% ;
2828}
2929
3030.sidebar {
3131 display : flex;
3232 flex-direction : column;
3333 width : var (--sidebarWidth );
34+ min-width : var (--sidebarMinWidth );
3435 height : 100% ;
3536 position : fixed;
3637 top : 0 ;
3738 left : 0 ;
3839 z-index : 100 ;
40+ resize : horizontal;
3941}
4042
4143.sidebar-button {
Original file line number Diff line number Diff line change 128128 height : 57px ;
129129 left : 56px ;
130130 right : 20px ;
131- transition : top 0.3 s ;
131+ transition : top var ( --sidebarTransitionDuration ) ease-in-out ;
132132 z-index : 99 ;
133133 }
134134
139139 right : 0 ;
140140 height : 70px ;
141141 background-color : var (--background );
142- transition : top 0.3 s ;
142+ transition : all var ( --sidebarTransitionDuration ) ease-in-out ;
143143 z-index : 98 ;
144144 }
145145
Original file line number Diff line number Diff line change @@ -204,3 +204,11 @@ function setPreference () {
204204 : ( state . sidebarPreference = userPref . CLOSED )
205205 }
206206}
207+
208+ const resizeObserver = new ResizeObserver ( ( entries ) => {
209+ for ( const entry of entries ) {
210+ document . body . style . setProperty ( '--sidebarWidth' , `${ entry . contentRect . width } px` ) ;
211+ }
212+ } ) ;
213+
214+ resizeObserver . observe ( document . getElementById ( 'sidebar' ) ) ;
You can’t perform that action at this time.
0 commit comments