Skip to content

Commit bc13bd2

Browse files
committed
fix: clean up and fix overflow / scrolling issues
1 parent 9240b29 commit bc13bd2

File tree

2 files changed

+21
-19
lines changed

2 files changed

+21
-19
lines changed

packages/uikit-workshop/src/sass/scss/01-abstracts/_mixins.scss

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,12 @@
101101
*/
102102
&.pl-is-active {
103103
max-height: calc(100vh - #{$offset-top} - 1rem);
104-
max-height: calc(
105-
var(--pl-viewport-height) - 1rem,
106-
100vh - #{$offset-top} - 1rem
104+
max-height: var(
105+
calc(--pl-viewport-height - 1rem),
106+
calc(100vh - #{$offset-top} - 1rem)
107107
); /* [1] */
108108
overflow: auto;
109+
-webkit-overflow-scrolling: touch;
109110
}
110111
}
111112

packages/uikit-workshop/src/sass/scss/04-components/_navigation.scss

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,38 +8,42 @@
88
* activates nav
99
*/
1010
.pl-c-nav {
11+
@include accordionPanel;
1112
background-color: inherit;
1213
position: absolute;
1314
top: 100%;
1415
width: 100%;
15-
overflow: hidden;
16-
max-height: 0; /* 1 */
1716
display: flex;
1817
flex-direction: column;
1918
transition: max-height $pl-animate-quick ease-out;
2019

20+
// if nav was opened on smaller screen and screen is resized, it'll be cut off otherwise
21+
@media all and (min-width: $pl-bp-med) {
22+
overflow: visible;
23+
max-height: none;
24+
}
25+
2126
/**
2227
* Active navigaiton
2328
* 1) Slide
2429
* 2) Set the height to the vierport height minus the height
2530
* of the header
2631
*/
2732
&.pl-is-active {
28-
max-height: calc(100vh - #{$offset-top} - 1rem); /* 2 */
29-
overflow: auto;
3033
box-shadow: 0 1px 1px $pl-color-black;
3134

32-
// if nav was opened on smaller screen and screen is resized, it'll be cut off otherwise
33-
@media all and (min-width: $pl-bp-med) {
34-
overflow: visible;
35+
.pl-c-body--theme-light & {
36+
box-shadow: 0 1px 1px darken($pl-color-gray-20, 15%);
3537
}
3638

3739
.pl-c-body--theme-sidebar & {
38-
overflow: hidden;
40+
box-shadow: none;
3941
}
4042

41-
.pl-c-body--theme-light & {
42-
box-shadow: 0 1px 1px darken($pl-color-gray-20, 15%);
43+
// if nav was opened on smaller screen and screen is resized, it'll be cut off otherwise
44+
@media all and (min-width: $pl-bp-med) {
45+
overflow: visible;
46+
max-height: none;
4347
}
4448
}
4549

@@ -48,8 +52,6 @@
4852
position: relative;
4953
top: auto;
5054
width: auto;
51-
overflow: visible;
52-
max-height: none;
5355
box-shadow: none;
5456
}
5557
}
@@ -154,8 +156,8 @@
154156
background-color: $pl-color-gray-87;
155157

156158
/**
157-
* Caret rotation and positioning in active dropdown
158-
*/
159+
* Caret rotation and positioning in active dropdown
160+
*/
159161
&:after {
160162
color: $pl-color-gray-50;
161163
transform: rotate(180deg);
@@ -176,7 +178,6 @@
176178
top: 100%; /* 1 */
177179
left: 0;
178180
min-width: 10rem;
179-
overflow: hidden;
180181
border-bottom-left-radius: $pl-border-radius-med;
181182
border-bottom-right-radius: $pl-border-radius-med;
182183
}
@@ -200,14 +201,14 @@
200201
.pl-c-nav__subsublist--dropdown.pl-is-active {
201202
margin-left: $pl-space / 2;
202203
visibility: visible;
204+
max-height: none;
203205

204206
@media all and (min-width: $pl-bp-med) {
205207
height: auto;
206208
max-height: calc(100vh - #{$offset-top} - 1rem); /* 1 */
207209
}
208210

209211
.pl-c-body--theme-sidebar & {
210-
overflow: hidden;
211212
max-height: none;
212213
}
213214
}

0 commit comments

Comments
 (0)