Skip to content

Commit 81c7fb3

Browse files
committed
fix modal so it always appears over mobile header and fix dropzone width
1 parent 0d96e0d commit 81c7fb3

File tree

3 files changed

+62
-60
lines changed

3 files changed

+62
-60
lines changed

packages/dev/s2-docs/pages/s2/DropZone.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ function Example(props) {
1919
return (
2020
<DropZone
2121
{...props}
22-
styles={style({width: 320})}
22+
styles={style({width: 320, maxWidth: '90%'})}
2323
/* PROPS */
2424
isFilled={!!content}
2525
// Determine whether dragged content should be accepted.
2626
getDropOperation={types => (
2727
['text/plain', 'image/jpeg', 'image/png', 'image/gif'].some(t => types.has(t))
28-
? 'copy'
28+
? 'copy'
2929
: 'cancel'
3030
)}
3131
onDrop={async (event) => {

packages/dev/s2-docs/src/Layout.tsx

Lines changed: 59 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -110,68 +110,70 @@ export function Layout(props: PageProps & {children: ReactElement<any>}) {
110110
lg: 'none'
111111
}
112112
})}>
113-
<Header pages={pages} currentPage={currentPage} />
114-
<MobileHeader
115-
toc={<MobileToc key="toc" toc={currentPage.tableOfContents ?? []} />}
116-
nav={<MobileNav key="nav" pages={pages} currentPage={currentPage} />} />
117-
<div className={style({display: 'flex', width: 'full'})}>
118-
<Nav pages={pages} currentPage={currentPage} />
119-
<main
120-
key={currentPage.url}
121-
style={{borderBottomLeftRadius: 0, borderBottomRightRadius: 0}}
122-
className={style({
123-
isolation: 'isolate',
124-
backgroundColor: 'base',
125-
padding: {
126-
default: 12,
127-
lg: 40
128-
},
129-
borderRadius: {
130-
default: 'none',
131-
lg: 'xl'
132-
},
133-
boxShadow: {
134-
lg: 'emphasized'
135-
},
136-
width: 'full',
137-
boxSizing: 'border-box',
138-
flexGrow: 1,
139-
display: 'flex',
140-
justifyContent: 'space-between',
141-
position: 'relative',
142-
height: {
143-
lg: '[calc(100vh - 72px)]'
144-
},
145-
overflow: {
146-
lg: 'auto'
147-
}
148-
})}>
149-
<article
113+
<div className={style({isolation: 'isolate', width: 'full'})}>
114+
<Header pages={pages} currentPage={currentPage} />
115+
<MobileHeader
116+
toc={<MobileToc key="toc" toc={currentPage.tableOfContents ?? []} />}
117+
nav={<MobileNav key="nav" pages={pages} currentPage={currentPage} />} />
118+
<div className={style({display: 'flex', width: 'full', marginTop: 12})}>
119+
<Nav pages={pages} currentPage={currentPage} />
120+
<main
121+
key={currentPage.url}
122+
style={{borderBottomLeftRadius: 0, borderBottomRightRadius: 0}}
150123
className={style({
151-
maxWidth: 768,
124+
isolation: 'isolate',
125+
backgroundColor: 'base',
126+
padding: {
127+
default: 12,
128+
lg: 40
129+
},
130+
borderRadius: {
131+
default: 'none',
132+
lg: 'xl'
133+
},
134+
boxShadow: {
135+
lg: 'emphasized'
136+
},
152137
width: 'full',
153-
height: 'fit'
154-
})}>
155-
{React.cloneElement(children, {components})}
156-
</article>
157-
<aside
158-
className={style({
159-
position: 'sticky',
160-
top: 0,
161-
height: 'fit',
162-
maxHeight: 'screen',
163-
overflow: 'auto',
164-
paddingY: 32,
165138
boxSizing: 'border-box',
166-
display: {
167-
default: 'none',
168-
lg: 'block'
139+
flexGrow: 1,
140+
display: 'flex',
141+
justifyContent: 'space-between',
142+
position: 'relative',
143+
height: {
144+
lg: '[calc(100vh - 72px)]'
145+
},
146+
overflow: {
147+
lg: 'auto'
169148
}
170149
})}>
171-
<div className={style({font: 'title', minHeight: 32, paddingX: 12, display: 'flex', alignItems: 'center'})}>Contents</div>
172-
<Toc toc={currentPage.tableOfContents?.[0]?.children ?? []} />
173-
</aside>
174-
</main>
150+
<article
151+
className={style({
152+
maxWidth: 768,
153+
width: 'full',
154+
height: 'fit'
155+
})}>
156+
{React.cloneElement(children, {components})}
157+
</article>
158+
<aside
159+
className={style({
160+
position: 'sticky',
161+
top: 0,
162+
height: 'fit',
163+
maxHeight: 'screen',
164+
overflow: 'auto',
165+
paddingY: 32,
166+
boxSizing: 'border-box',
167+
display: {
168+
default: 'none',
169+
lg: 'block'
170+
}
171+
})}>
172+
<div className={style({font: 'title', minHeight: 32, paddingX: 12, display: 'flex', alignItems: 'center'})}>Contents</div>
173+
<Toc toc={currentPage.tableOfContents?.[0]?.children ?? []} />
174+
</aside>
175+
</main>
176+
</div>
175177
</div>
176178
</body>
177179
</Provider>

packages/dev/s2-docs/src/MobileHeader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ export function MobileHeader({toc, nav}) {
173173
flexGrow: 1
174174
})}>
175175
<AdobeLogo />
176-
<h2
176+
<h2
177177
className={style({
178178
font: 'heading-sm',
179179
marginY: 0,

0 commit comments

Comments
 (0)