@@ -30,20 +30,16 @@ export function DocsLayout({ tree, children, ...props }: DocsLayoutProps) {
3030 < Header
3131 links = { props . links }
3232 nav = { props . nav }
33- themeSwitch = { props . themeSwitch }
34- searchToggle = { props . searchToggle }
3533 i18n = { props . i18n }
3634 githubUrl = { props . githubUrl }
3735 />
3836
3937 < div { ...stylex . props ( layoutStyles . wrapper ) } >
4038 < main id = "nd-docs-layout" { ...stylex . props ( layoutStyles . main ) } >
4139 < Sidebar />
42- < div { ...stylex . props ( layoutStyles . content ) } >
43- { children }
44- </ div >
40+ < div { ...stylex . props ( layoutStyles . content ) } > { children } </ div >
41+ < Footer />
4542 </ main >
46- < Footer />
4743 </ div >
4844 </ TreeContextProvider >
4945 ) ;
@@ -85,22 +81,27 @@ const layoutStyles = stylex.create({
8581 main : {
8682 // flex flex-1 flex-row [--fd-nav-height:56px]
8783 display : 'flex' ,
84+ flexDirection : 'column' ,
8885 flexGrow : 1 ,
89- flexDirection : 'row' ,
90- [ '--fd-nav-height' as any ] : '56px' ,
86+ // flexDirection: 'row',
87+ [ '--fd-nav-height' as any ] : '64px' ,
88+ paddingInlineStart : {
89+ default : 292 ,
90+ '@media (max-width: 767.9px)' : 0 ,
91+ } ,
9192 } ,
9293 content : {
93- display : 'flex' ,
94- flexDirection : 'column' ,
95- flexGrow : 1 ,
96- minWidth : 0 ,
94+ // flexGrow: 1,
95+ // minWidth: 0,
9796 } ,
9897} ) ;
9998
10099function Sidebar ( ) {
101100 const { root } = useTreeContext ( ) ;
102101 const [ open ] = use ( SidebarContext ) ;
103102
103+ console . log ( 'open' , open ) ;
104+
104105 const children = useMemo ( ( ) => {
105106 function renderItems ( items : PageTree . Node [ ] ) {
106107 return items . map ( ( item ) => (
@@ -123,6 +124,10 @@ function Sidebar() {
123124 open === false && sidebarStyles . closed ,
124125 ) }
125126 >
127+ < div { ...stylex . props ( sidebarStyles . blurContainer ) } >
128+ < div { ...stylex . props ( sidebarStyles . blur ) } />
129+ </ div >
130+
126131 < aside { ...stylex . props ( sidebarStyles . base ) } ref = { sidebarRef } >
127132 { children }
128133 </ aside >
@@ -131,37 +136,64 @@ function Sidebar() {
131136}
132137const sidebarStyles = stylex . create ( {
133138 container : {
134- position : 'sticky' ,
135- top : 56 ,
139+ position : 'fixed' ,
140+ top : 64 ,
141+ left : 0 ,
136142 display : {
137143 default : 'flex' ,
138144 '@media (max-width: 767.9px)' : 'none' ,
139145 } ,
140146 alignSelf : 'flex-start' ,
141147 flexShrink : 0 ,
142148 padding : 8 ,
143- height : 'calc(100dvh - 56px)' ,
149+ height : 'calc(100dvh - 64px)' ,
150+ transform : {
151+ default : 'translateX(0px)' ,
152+ '@media (max-width: 767.9px)' : 'translateX(-100%)' ,
153+ } ,
154+ transitionProperty : 'transform' ,
155+ transitionDuration : '0.15s' ,
156+ transitionTimingFunction : 'cubic-bezier(0.4, 0, 0.2, 1)' ,
144157 zIndex : 10 ,
145158 } ,
159+ open : {
160+ transform : 'translateX(0)' ,
161+ } ,
162+ closed : {
163+ transform : 'translateX(-100%)' ,
164+ } ,
165+ blurContainer : {
166+ position : 'absolute' ,
167+ inset : 8 ,
168+ overflow : 'hidden' ,
169+ borderRadius : 20 ,
170+ cornerShape : 'squircle' ,
171+ zIndex : 1 ,
172+ } ,
173+ blur : {
174+ position : 'absolute' ,
175+ inset : - 64 ,
176+ insetInlineStart : - 8 ,
177+ backdropFilter : 'blur(32px) saturate(800%)' ,
178+ } ,
146179 base : {
147180 display : 'flex' ,
148181 flexDirection : 'column' ,
149182 gap : 2 ,
150183 padding : 4 * 4 ,
151- fontSize : `${ 14 / 16 } rem ` ,
184+ fontSize : `1rem ` ,
152185 overflowY : 'auto' ,
153186 overscrollBehavior : 'contain' ,
154187 width : 280 ,
155188 height : '100%' ,
156- backgroundColor : 'var(--color-fd-background)' ,
157189 borderRadius : 20 ,
190+ cornerShape : 'squircle' ,
158191 borderWidth : 1 ,
159192 borderStyle : 'solid' ,
160193 borderColor : 'var(--color-fd-border)' ,
161194 boxShadow : '0 4px 16px rgba(0, 0, 0, 0.06)' ,
195+ zIndex : 10 ,
162196 } ,
163- open : { } ,
164- closed : { } ,
165197} ) ;
166198
167199function SidebarItem ( {
@@ -333,7 +365,7 @@ const linkVariants = stylex.create({
333365 position : 'relative' ,
334366 display : 'inline-flex' ,
335367 alignItems : 'center' ,
336- fontSize : `${ 14 / 16 } rem ` ,
368+ fontSize : `1rem ` ,
337369 lineHeight : 1.42 ,
338370 gap : 2 * 4 ,
339371 paddingBlock : 1.5 * 4 ,
0 commit comments