Skip to content

Commit

Permalink
Add "click" overlay to close masthead and follow button menus when open
Browse files Browse the repository at this point in the history
  • Loading branch information
mmistakes committed Mar 9, 2020
1 parent b322450 commit ca28356
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 9 deletions.
2 changes: 1 addition & 1 deletion _sass/minimal-mistakes/_masthead.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
-ms-flex-item-align: center;
align-self: center;
font-weight: bold;
z-index: 20;
// z-index: 20;
}

.site-subtitle {
Expand Down
40 changes: 32 additions & 8 deletions _sass/minimal-mistakes/_sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

.sidebar {
@include clearfix();
@include breakpoint(max-width $large) {
/* fix z-index order of follow links */
position: relative;
z-index: 10;
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
// @include breakpoint(max-width $large) {
// /* fix z-index order of follow links */
// position: relative;
// z-index: 10;
// -webkit-transform: translate3d(0, 0, 0);
// transform: translate3d(0, 0, 0);
// }

@include breakpoint($large) {
float: left;
Expand Down Expand Up @@ -63,7 +63,7 @@

img {
width: 100%;

&.emoji {
width: 20px;
height: 20px;
Expand Down Expand Up @@ -199,8 +199,27 @@
}

button {
position: relative;
margin-bottom: 0;

&:before {
@supports (pointer-events: none) {
content: '';
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
}
}

&.open {
&:before {
pointer-events: auto;
}
}

@include breakpoint($large) {
display: none;
}
Expand Down Expand Up @@ -269,6 +288,11 @@
}
}

ul {
padding: 10px;
list-style-type: none;
}

li {
white-space: nowrap;
}
Expand Down
27 changes: 27 additions & 0 deletions _sass/minimal-mistakes/_utilities.scss
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,33 @@ body:hover .visually-hidden button {
}
}

.greedy-nav__toggle {
&:before {
@supports (pointer-events: none) {
content: '';
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
background-color: $background-color;
-webkit-transition: $global-transition;
transition: $global-transition;
pointer-events: none;
}
}

&.close {
&:before {
opacity: 0.9;
-webkit-transition: $global-transition;
transition: $global-transition;
pointer-events: auto;
}
}
}

.greedy-nav__toggle:hover {
.navicon,
.navicon:before,
Expand Down

0 comments on commit ca28356

Please sign in to comment.