Skip to content

Commit 26a67c2

Browse files
committed
fix modal so it always appears over mobile header and fix dropzone width
1 parent cccd809 commit 26a67c2

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