Fix mobile menu friendliness!
This commit is contained in:
parent
9333e5a14d
commit
3ba38ee3b7
7 changed files with 29 additions and 5 deletions
|
|
@ -113,6 +113,8 @@
|
|||
padding-left: 3rem;
|
||||
background-color: lighten($background, 15%);
|
||||
|
||||
display: none;
|
||||
height: 0;
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
|
||||
|
|
@ -120,6 +122,8 @@
|
|||
transition-property: visibility, opacity;
|
||||
|
||||
&.visible {
|
||||
display: inline-flex;
|
||||
height: 4rem;
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
transition-duration: 200ms, 0;
|
||||
|
|
|
|||
|
|
@ -737,6 +737,8 @@ body {
|
|||
.mobile-menu .sub.item {
|
||||
padding-left: 3rem;
|
||||
background-color: #4b4b4b;
|
||||
display: none;
|
||||
height: 0;
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
-webkit-transition-duration: 200ms, 200ms;
|
||||
|
|
@ -746,6 +748,10 @@ body {
|
|||
}
|
||||
|
||||
.mobile-menu .sub.item.visible {
|
||||
display: -webkit-inline-box;
|
||||
display: -ms-inline-flexbox;
|
||||
display: inline-flex;
|
||||
height: 4rem;
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
-webkit-transition-duration: 200ms, 0;
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -737,6 +737,8 @@ body {
|
|||
.mobile-menu .sub.item {
|
||||
padding-left: 3rem;
|
||||
background-color: white;
|
||||
display: none;
|
||||
height: 0;
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
-webkit-transition-duration: 200ms, 200ms;
|
||||
|
|
@ -746,6 +748,10 @@ body {
|
|||
}
|
||||
|
||||
.mobile-menu .sub.item.visible {
|
||||
display: -webkit-inline-box;
|
||||
display: -ms-inline-flexbox;
|
||||
display: inline-flex;
|
||||
height: 4rem;
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
-webkit-transition-duration: 200ms, 0;
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -47,10 +47,18 @@ window.addEventListener("DOMContentLoaded", (evt) => {
|
|||
let id = `subMenu_${new Date().getMilliseconds()}`;
|
||||
el.setAttribute("from", id);
|
||||
|
||||
let subMenuItems = [];
|
||||
|
||||
el.querySelectorAll(".compact.sub.item").forEach((child) => {
|
||||
subMenuItems.push(child);
|
||||
});
|
||||
|
||||
subMenuItems.reverse();
|
||||
|
||||
subMenuItems.forEach((child) => {
|
||||
child.setAttribute("for", id);
|
||||
child.textContent = `${child.textContent}`;
|
||||
el.parentElement.appendChild(child);
|
||||
el.parentElement.insertBefore(child, el.nextSibling);
|
||||
});
|
||||
});
|
||||
});
|
||||
Loading…
Reference in a new issue