@@ -29,112 +29,123 @@ export function Footer(props: { context: GitBookSiteContext }) {
2929 className = { tcls (
3030 'border-tint-subtle border-t' ,
3131 // If the footer only contains a mode toggle, we only show it on smaller screens
32- mobileOnly ? 'xl :hidden' : null
32+ mobileOnly ? '@7xl :hidden' : null
3333 ) }
3434 >
35- < div className = { tcls ( CONTAINER_STYLE , 'px-4' , 'py-8' , ' lg:py-12' , 'mx-auto' ) } >
35+ < div className = "motion-safe:transition-[padding] motion-safe:duration-300 lg:chat-open:pr-80 xl:chat-open:pr-96" >
3636 < div
3737 className = { tcls (
38- 'mx-auto grid max-w-3xl site-width-wide:max-w-screen-2xl justify-between gap-12 lg:max-w-none!' ,
39- 'grid-cols-[auto_auto]' ,
40- 'lg:grid-cols-[18rem_minmax(auto,48rem)_auto]' ,
41- 'xl:grid-cols-[18rem_minmax(auto,48rem)_14rem]' ,
42- 'lg:site-width-wide:grid-cols-[18rem_minmax(auto,80rem)_auto]' ,
43- 'xl:site-width-wide:grid-cols-[18rem_minmax(auto,80rem)_14rem]' ,
44- 'lg:page-no-toc:grid-cols-[minmax(auto,48rem)_auto]' ,
45- 'xl:page-no-toc:grid-cols-[14rem_minmax(auto,48rem)_14rem]' ,
46- 'lg:[body:has(.site-width-wide,.page-no-toc)_&]:grid-cols-[minmax(auto,90rem)_auto]' ,
47- 'xl:[body:has(.site-width-wide,.page-no-toc)_&]:grid-cols-[14rem_minmax(auto,90rem)_14rem]'
38+ CONTAINER_STYLE ,
39+ 'px-4' ,
40+ 'py-8' ,
41+ '@4xl:py-12' ,
42+ 'mx-auto' ,
43+ '@container/footer'
4844 ) }
4945 >
50- {
51- // Footer Logo
52- customization . footer . logo ? (
53- < div className = "col-start-1 row-start-1" >
54- < Image
55- alt = "Logo"
56- resize = { context . imageResizer }
57- sources = { {
58- light : {
59- src : customization . footer . logo . light ,
60- } ,
61- dark : customization . footer . logo . dark
62- ? {
63- src : customization . footer . logo . dark ,
64- }
65- : null ,
66- } }
67- loading = "lazy"
68- style = { [
69- 'w-auto' ,
70- 'max-w-40' ,
71- 'lg:max-w-64' ,
72- 'max-h-10' ,
73- 'lg:max-h-12' ,
74- 'object-contain' ,
75- 'object-left' ,
76- 'rounded-sm' ,
77- 'straight-corners:rounded-xs' ,
78- ] }
79- sizes = { [
80- {
81- width : 320 ,
82- } ,
83- ] }
84- />
85- </ div >
86- ) : null
87- }
46+ < div
47+ className = { tcls (
48+ 'mx-auto flex @xs:grid @4xl:max-w-none! max-w-3xl site-width-wide:max-w-screen-2xl flex-col justify-between gap-12' ,
49+ 'grid-cols-[auto_auto]' ,
50+ '@4xl:grid-cols-[18rem_minmax(auto,48rem)_auto]' ,
51+ '@7xl:grid-cols-[18rem_minmax(auto,48rem)_14rem]' ,
52+ '@4xl:site-width-wide:grid-cols-[18rem_minmax(auto,80rem)_auto]' ,
53+ '@7xl:site-width-wide:grid-cols-[18rem_minmax(auto,80rem)_14rem]' ,
54+ '@4xl:page-no-toc:grid-cols-[minmax(auto,48rem)_auto]' ,
55+ '@7xl:page-no-toc:grid-cols-[14rem_minmax(auto,48rem)_14rem]' ,
56+ '@4xl:[body:has(.site-width-wide,.page-no-toc)_&]:grid-cols-[minmax(auto,90rem)_auto]' ,
57+ '@7xl:[body:has(.site-width-wide,.page-no-toc)_&]:grid-cols-[14rem_minmax(auto,90rem)_14rem]'
58+ ) }
59+ >
60+ {
61+ // Footer Logo
62+ customization . footer . logo ? (
63+ < div className = "col-start-1 row-start-1" >
64+ < Image
65+ alt = "Logo"
66+ resize = { context . imageResizer }
67+ sources = { {
68+ light : {
69+ src : customization . footer . logo . light ,
70+ } ,
71+ dark : customization . footer . logo . dark
72+ ? {
73+ src : customization . footer . logo . dark ,
74+ }
75+ : null ,
76+ } }
77+ loading = "lazy"
78+ style = { [
79+ 'w-auto' ,
80+ 'max-w-40' ,
81+ '@4xl:max-w-64' ,
82+ 'max-h-10' ,
83+ '@4xl:max-h-12' ,
84+ 'object-contain' ,
85+ 'object-left' ,
86+ 'rounded-sm' ,
87+ 'straight-corners:rounded-xs' ,
88+ ] }
89+ sizes = { [
90+ {
91+ width : 320 ,
92+ } ,
93+ ] }
94+ />
95+ </ div >
96+ ) : null
97+ }
8898
89- {
90- // Theme Toggle
91- customization . themes . toggeable ? (
92- < div className = "-col-start-2 row-start-1 flex items-start justify-end xl:hidden" >
93- < React . Suspense fallback = { null } >
94- < ThemeToggler />
95- </ React . Suspense >
96- </ div >
97- ) : null
98- }
99+ {
100+ // Theme Toggle
101+ customization . themes . toggeable ? (
102+ < div className = "-col-start-2 row-start-1 flex items-start @xs: justify-end xl:hidden" >
103+ < React . Suspense fallback = { null } >
104+ < ThemeToggler />
105+ </ React . Suspense >
106+ </ div >
107+ ) : null
108+ }
99109
100- {
101- // Navigation groups (split into equal columns)
102- customization . footer . groups ?. length > 0 ? (
103- < div
104- className = { tcls (
105- 'col-span-2 lg:page-has-toc:col-span-1 lg:page-has-toc:col-start-2 xl:page-no-toc:col-span-1 xl:page-no-toc:col-start-2'
106- ) }
107- >
108- < div className = "mx-auto flex max-w-3xl site-width-wide:max-w-screen-2xl flex-col gap-10 sm:flex-row sm:gap-6" >
109- { partition ( customization . footer . groups , FOOTER_COLUMNS ) . map (
110- ( column , columnIndex ) => (
111- < div
112- key = { columnIndex }
113- className = "flex flex-1 grow flex-col gap-10"
114- >
115- { column . map ( ( group , groupIndex ) => (
116- < FooterLinksGroup
117- key = { groupIndex }
118- group = { group }
119- context = { context }
120- />
121- ) ) }
122- </ div >
123- )
110+ {
111+ // Navigation groups (split into equal columns)
112+ customization . footer . groups ?. length > 0 ? (
113+ < div
114+ className = { tcls (
115+ '@4xl:page-has-toc:col-span-1 @7xl:page-no-toc:col-span-1 col-span-2 @4xl:page-has-toc:col-start-2 @7xl:page-no-toc:col-start-2'
124116 ) }
117+ >
118+ < div className = "mx-auto flex max-w-3xl site-width-wide:max-w-screen-2xl @xl:flex-row flex-col @xl:gap-6 gap-10" >
119+ { partition ( customization . footer . groups , FOOTER_COLUMNS ) . map (
120+ ( column , columnIndex ) => (
121+ < div
122+ key = { columnIndex }
123+ className = "flex flex-1 grow flex-col gap-10"
124+ >
125+ { column . map ( ( group , groupIndex ) => (
126+ < FooterLinksGroup
127+ key = { groupIndex }
128+ group = { group }
129+ context = { context }
130+ />
131+ ) ) }
132+ </ div >
133+ )
134+ ) }
135+ </ div >
125136 </ div >
126- </ div >
127- ) : null
128- }
137+ ) : null
138+ }
129139
130- {
131- // Legal
132- customization . footer . copyright ? (
133- < div className = "order-last col-span-full flex w-full grow flex-col items-center gap-2 text-center text-tint text-xs" >
134- < p > { customization . footer . copyright } </ p >
135- </ div >
136- ) : null
137- }
140+ {
141+ // Legal
142+ customization . footer . copyright ? (
143+ < div className = "order-last col-span-full flex w-full grow flex-col items-center gap-2 text-center text-tint text-xs" >
144+ < p > { customization . footer . copyright } </ p >
145+ </ div >
146+ ) : null
147+ }
148+ </ div >
138149 </ div >
139150 </ div >
140151 </ footer >
0 commit comments