Skip to content

Commit a53f849

Browse files
committed
fix(#1999): adjust css so that main scrolls rather than body
1 parent 38d3ad6 commit a53f849

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

packages/dev/docs/src/client.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ function DocSearch() {
283283
};
284284

285285
return (
286-
<ThemeProvider>
286+
<ThemeProvider UNSAFE_className={docsStyle.docSearchBoxThemeProvider}>
287287
<span role="search">
288288
<SearchAutocomplete
289289
aria-label="Search"

packages/dev/docs/src/docs.css

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@
7171
html, body {
7272
margin: 0;
7373
text-size-adjust: none;
74+
height: 100vh;
75+
overflow-y: hidden;
76+
overflow-anchor: none;
7477
}
7578

7679
.provider {
@@ -290,14 +293,16 @@ html, body {
290293
}
291294

292295
main {
296+
margin-top: var(--spectrum-global-dimension-size-550);
293297
margin-left: 256px;
294298
margin-right: 180px;
295-
padding: 40px 52px 0 52px;
299+
padding: 0 52px;
296300
box-sizing: border-box;
297301
display: flex;
298-
min-height: 100vh;
302+
height: calc(100vh - var(--spectrum-global-dimension-size-550));
299303
flex-direction: column;
300304
align-items: center;
305+
overflow-y: auto;
301306
}
302307

303308
.article {
@@ -627,6 +632,10 @@ h2.sectionHeader {
627632
z-index: 1;
628633
}
629634

635+
.docSearchBoxThemeProvider {
636+
height: var(--spectrum-global-dimension-size-400);
637+
}
638+
630639
.docSearchBox {
631640
margin-inline-start: auto;
632641
width: var(--spectrum-global-dimension-size-3600);
@@ -845,8 +854,8 @@ h2.sectionHeader {
845854

846855
main {
847856
margin-left: 0;
848-
margin-top: 48px;
849-
padding: 40px 24px;
857+
margin-top: var(--spectrum-global-dimension-size-550);
858+
padding: var(--spectrum-global-dimension-size-325) var(--spectrum-global-dimension-size-250);
850859
}
851860

852861
/* Show the toolbar at the top with the hamburger and theme switcher buttons */
@@ -857,6 +866,7 @@ h2.sectionHeader {
857866
display: flex;
858867
width: 100%;
859868
}
869+
860870
.hamburgerButton {
861871
display: inline-flex;
862872
}

0 commit comments

Comments
 (0)