Skip to content

Commit ca28356

Browse files
committedMar 9, 2020
Add "click" overlay to close masthead and follow button menus when open
Fixes mmistakes#1168
1 parent b322450 commit ca28356

File tree

3 files changed

+60
-9
lines changed

3 files changed

+60
-9
lines changed
 

‎_sass/minimal-mistakes/_masthead.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
-ms-flex-item-align: center;
5151
align-self: center;
5252
font-weight: bold;
53-
z-index: 20;
53+
// z-index: 20;
5454
}
5555

5656
.site-subtitle {

‎_sass/minimal-mistakes/_sidebar.scss

+32-8
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88

99
.sidebar {
1010
@include clearfix();
11-
@include breakpoint(max-width $large) {
12-
/* fix z-index order of follow links */
13-
position: relative;
14-
z-index: 10;
15-
-webkit-transform: translate3d(0, 0, 0);
16-
transform: translate3d(0, 0, 0);
17-
}
11+
// @include breakpoint(max-width $large) {
12+
// /* fix z-index order of follow links */
13+
// position: relative;
14+
// z-index: 10;
15+
// -webkit-transform: translate3d(0, 0, 0);
16+
// transform: translate3d(0, 0, 0);
17+
// }
1818

1919
@include breakpoint($large) {
2020
float: left;
@@ -63,7 +63,7 @@
6363

6464
img {
6565
width: 100%;
66-
66+
6767
&.emoji {
6868
width: 20px;
6969
height: 20px;
@@ -199,8 +199,27 @@
199199
}
200200

201201
button {
202+
position: relative;
202203
margin-bottom: 0;
203204

205+
&:before {
206+
@supports (pointer-events: none) {
207+
content: '';
208+
position: fixed;
209+
top: 0;
210+
left: 0;
211+
width: 100%;
212+
height: 100%;
213+
pointer-events: none;
214+
}
215+
}
216+
217+
&.open {
218+
&:before {
219+
pointer-events: auto;
220+
}
221+
}
222+
204223
@include breakpoint($large) {
205224
display: none;
206225
}
@@ -269,6 +288,11 @@
269288
}
270289
}
271290

291+
ul {
292+
padding: 10px;
293+
list-style-type: none;
294+
}
295+
272296
li {
273297
white-space: nowrap;
274298
}

‎_sass/minimal-mistakes/_utilities.scss

+27
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,33 @@ body:hover .visually-hidden button {
385385
}
386386
}
387387

388+
.greedy-nav__toggle {
389+
&:before {
390+
@supports (pointer-events: none) {
391+
content: '';
392+
position: fixed;
393+
top: 0;
394+
left: 0;
395+
width: 100%;
396+
height: 100%;
397+
opacity: 0;
398+
background-color: $background-color;
399+
-webkit-transition: $global-transition;
400+
transition: $global-transition;
401+
pointer-events: none;
402+
}
403+
}
404+
405+
&.close {
406+
&:before {
407+
opacity: 0.9;
408+
-webkit-transition: $global-transition;
409+
transition: $global-transition;
410+
pointer-events: auto;
411+
}
412+
}
413+
}
414+
388415
.greedy-nav__toggle:hover {
389416
.navicon,
390417
.navicon:before,

0 commit comments

Comments
 (0)
Please sign in to comment.