Make icon only menu layout default

This commit is contained in:
Alice Gaudon 2020-07-15 11:04:45 +02:00
parent e7e5981af7
commit c87eec28b2
2 changed files with 89 additions and 7 deletions

View File

@ -63,21 +63,54 @@ header {
li { li {
list-style: none; list-style: none;
a, span { a, button {
position: relative;
height: 64px;
margin: 0;
padding: 0 24px;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
height: 64px;
padding: 0 24px; &:hover, &:active {
&:not(button) {
background-color: rgba(255, 255, 255, 0.07);
}
.tip {
visibility: visible;
opacity: 1;
transition: opacity ease-out 100ms;
transition-delay: 150ms;
}
}
.feather { .feather {
--icon-size: 24px; --icon-size: 24px;
margin-right: 10px;
} }
} }
a:hover, a:active { button {
background-color: rgba(255, 255, 255, 0.07); margin: 8px;
padding: 24px;
height: 32px;
.feather {
margin-right: 0;
}
.tip {
text-transform: initial;
font-weight: initial;
}
}
form {
display: flex;
justify-content: center;
align-items: center;
padding: 0;
} }
} }
} }
@ -129,6 +162,55 @@ header {
&.open { &.open {
transform: translateX(0%); transform: translateX(0%);
} }
li {
a, button {
.tip {
display: block;
margin-left: 8px;
text-transform: inherit;
font-weight: inherit;
}
}
}
}
}
}
@media (min-width: $menuLayoutSwitchTreshold) {
nav ul li {
a, button {
.tip {
visibility: hidden;
position: absolute;
display: block;
width: max-content;
height: 30px;
padding: 4px 8px;
line-height: 22px;
top: calc(100% + 8px);
left: 50%;
transform: translateX(-50%);
text-align: center;
font-size: 18px;
color: $defaultTextColor;
opacity: 0;
transition: opacity ease-out 100ms, visibility step-end 150ms;
transition-delay: 0ms;
background-color: #000;
border-radius: 5px;
}
}
&:last-child {
a, button {
.tip {
left: unset;
right: 4px;
transform: none;
}
}
} }
} }
} }

View File

@ -16,7 +16,7 @@
<nav> <nav>
<button id="menu-button"><i data-feather="menu"></i></button> <button id="menu-button"><i data-feather="menu"></i></button>
<ul id="main-menu"> <ul id="main-menu">
<li><a href="{{ route('about') }}"><i data-feather="info"></i> About</a></li> <li><a href="{{ route('about') }}"><i data-feather="info"></i> <span class="tip">About</span></a></li>
</ul> </ul>
</nav> </nav>
{% endblock %} {% endblock %}