Skip to content

Commit 48878b9

Browse files
committed
Use CSS grid for horizontal layout to fix Safari scrolling issues
1 parent 96fe7bf commit 48878b9

File tree

6 files changed

+42
-11
lines changed

6 files changed

+42
-11
lines changed

packages/webdoc-default-template/src/styles/global.scss

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ a {
3232

3333
.page {
3434
$page: &;
35-
@include flex();
3635

3736
width: 100%;
3837
@include center-margin();
@@ -50,11 +49,18 @@ a {
5049
}
5150
}
5251

52+
grid-row: 1;
53+
max-height: 100%;
54+
min-width: fit-content;
5355
max-width: 400px;
5456
overflow: auto;
5557
}
5658

59+
&-explorer {
60+
grid-column: 1;
61+
}
5762
&-members-explorer {
63+
grid-column: 3;
5864
min-width: 200px;
5965
}
6066
&-members-explorer > *:first-child {
@@ -68,17 +74,24 @@ a {
6874
}
6975

7076
&-content {
77+
grid-row: 1;
78+
grid-column: 2;
79+
80+
display: flex;
81+
flex-direction: column;
7182
color: $colorText;
7283
font-family: Arial, Roboto, sans-serif;
7384
flex-grow: 2;
7485
flex-shrink: 1;
7586
height: 100%;
7687
overflow-x: hidden;// TODO: Slight horizontal scrolling pops up for some reason
77-
overflow-y: auto;
88+
overflow-y: scroll;
89+
max-height: 100%;
90+
min-width: 0;
7891
max-width: 800px;
7992
padding-left: 67px;
8093
padding-right: 83px;
81-
width: 0;
94+
-webkit-overflow-scrolling: touch;
8295

8396
@media only screen and (max-width: 1025px) {
8497
padding-left: 34px;
@@ -93,10 +106,14 @@ a {
93106
margin-top: 24px;
94107
}
95108
&-r-divider {
109+
grid-row: 1;
110+
grid-column: 3;
111+
96112
border: 1px solid $colorPrimaryLight;
97113
margin: 0;
98114
margin-top: 68px;
99115
height: 67vh;
116+
width: 0;
100117
}
101118
}
102119
}

packages/webdoc-default-template/src/styles/header.scss

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,19 @@
66
display: flex;
77
flex-direction: column;
88
flex-grow: 1;
9-
overflow-y: auto;
109
min-width: 0;
1110
max-height: 100%;
1211

1312
&__content {
14-
display: flex;
15-
overflow: auto;
13+
display: grid;
14+
grid-template-rows: 100%;
15+
grid-template-columns: fit-content(100%) minmax(0, max-content) fit-content(100%) minmax(0, 1fr);
16+
max-height: 100%;
17+
overflow: hidden;/* child element must overflow/scroll on their own */
18+
19+
@media only screen and (max-width: 800px) {
20+
grid-template-columns: fit-content(100%) minmax(0, max-content);
21+
}
1622
}
1723
}
1824

packages/webdoc-default-template/src/styles/members-explorer.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,9 @@
4848
display: none;
4949
}
5050
}
51+
52+
.page-r-divider {
53+
@media only screen and (max-width: 800px) {
54+
display: none;
55+
}
56+
}

0 commit comments

Comments
 (0)