Skip to content

Commit 1b34258

Browse files
authored
bug: Fix dropdown quirk mobile and desktop (#778)
* bug: fix drop down non mobile position * bug: fix mobile mode
1 parent 15f897d commit 1b34258

File tree

1 file changed

+39
-25
lines changed

1 file changed

+39
-25
lines changed

_sass/minimal-mistakes/_pyos-dropdown.scss

Lines changed: 39 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
========================================================================== */
88

99
.nav__links {
10-
overflow: hidden;
10+
overflow: visible;
1111
margin: 0 auto;
1212
padding: 0;
1313
display: flex;
@@ -50,13 +50,16 @@
5050
display: flex;
5151
flex-direction: column;
5252
align-items: flex-start;
53-
padding: 0 1em;
54-
margin-top: 3em;
55-
top: 90%;
53+
padding: 1em;
54+
margin-top: 0.5em;
55+
top: 100%;
5656
left: 5%;
5757
right: 5%;
58-
gap: 0;
59-
font-size: 1.2em;
58+
gap: 0.25em;
59+
font-size: 1em;
60+
height: auto;
61+
max-height: calc(100vh - 6rem);
62+
overflow-y: auto;
6063
background-color: $pyos-white;
6164
z-index: 1;
6265
border: 1px solid $border-color;
@@ -68,32 +71,50 @@
6871
0 2px 4px 0 rgba(0, 0, 0, 0.16),
6972
0 2px 10px 0 rgba(0, 0, 0, 0.12);
7073

74+
> li {
75+
width: 100%;
76+
padding: 0.5em 0;
77+
display: block;
78+
align-items: initial;
79+
}
80+
7181
a {
7282
float: none;
7383
display: block;
7484
text-align: left;
75-
}
76-
77-
li {
78-
width: 100%;
85+
padding: 0.5em 0;
86+
font-size: 1em;
87+
color: $nav-font-color;
7988
}
8089

8190
.dropdown {
82-
float: none;
91+
width: 100%;
92+
position: static;
93+
overflow: visible;
8394

8495
.dropbtn {
8596
width: 100%;
8697
text-align: left;
8798
display: block;
88-
padding: 1em 0;
89-
99+
padding: 0.75em 0;
100+
cursor: pointer;
90101
}
91102

92103
.dropdown-content {
104+
display: none;
105+
position: relative;
93106
width: 100%;
94107
min-width: 100%;
95-
position: relative;
96-
box-shadow: unset;
108+
box-shadow: none;
109+
background-color: transparent;
110+
padding-left: 1em;
111+
margin-top: 0.5em;
112+
top: auto;
113+
left: 0;
114+
115+
&.open {
116+
display: block;
117+
}
97118
}
98119
}
99120
}
@@ -121,11 +142,6 @@
121142
}
122143
}
123144

124-
/* Force nav links fonts to be same size */
125-
.nav__links a {
126-
font-size: 0.9em !important;
127-
}
128-
129145
/* Dropdown container for nav links */
130146
.dropdown {
131147
float: left;
@@ -152,8 +168,9 @@
152168
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
153169
z-index: 1;
154170
width: 100%;
171+
top: 100%;
155172
transition: all 0.25s ease-in;
156-
transform: translateY(-10px);
173+
transform: translateY(0px);
157174
position: absolute;
158175

159176
&.open {
@@ -321,11 +338,8 @@
321338
}
322339

323340
/* Nav links goes vertical in responsive mode */
324-
.nav__links .vertical {
325-
position: absolute;
341+
.nav__links.vertical {
326342
display: flex;
327-
flex-direction: column;
328-
align-items: flex-start;
329343
}
330344

331345
.hamburger__btn-toggle {

0 commit comments

Comments
 (0)