Improve tips styling and allow it in any button

This commit is contained in:
Alice Gaudon 2020-07-30 10:54:14 +02:00
parent ba3a7a3caf
commit 5eb8fa1f1e
1 changed files with 47 additions and 44 deletions

View File

@ -21,6 +21,46 @@ body {
background-color: $backgroundColor;
}
@mixin tip {
position: relative;
.tip {
visibility: hidden;
position: absolute;
z-index: 10000;
pointer-events: none;
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;
text-transform: initial;
font-weight: initial;
}
&:hover, &:active {
.tip {
visibility: visible;
opacity: 1;
transition: opacity ease-out 100ms;
transition-delay: 150ms;
}
}
}
header {
display: flex;
flex-direction: row;
@ -77,27 +117,11 @@ header {
&:not(button) {
background-color: rgba(255, 255, 255, 0.07);
}
.tip {
visibility: visible;
opacity: 1;
transition: opacity ease-out 100ms;
transition-delay: 150ms;
}
}
.feather {
--icon-size: 24px;
}
&:hover {
.tip {
visibility: visible;
opacity: 1;
transition: opacity ease-out 100ms;
transition-delay: 150ms;
}
}
}
button {
@ -108,11 +132,6 @@ header {
.feather {
margin-right: 0;
}
.tip {
text-transform: initial;
font-weight: initial;
}
}
form {
@ -188,32 +207,12 @@ header {
@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;
}
a, button, .button {
@include tip;
}
&:last-child {
a, button {
a, button, .button {
.tip {
left: unset;
right: 4px;
@ -235,6 +234,10 @@ footer {
main {
flex: 1;
padding: 8px;
button, .button {
@include tip;
}
}
h1 {