refactor: better use of scss features
This commit is contained in:
parent
fd3c8f6449
commit
2bb3abab52
1 changed files with 57 additions and 56 deletions
|
@ -28,9 +28,8 @@ export default {
|
|||
|
||||
.nav {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.nav__list {
|
||||
&__list {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
|
@ -44,14 +43,14 @@ export default {
|
|||
@include mq-desktop {
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.nav__item {
|
||||
&__item {
|
||||
padding: 0.375em;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
.nav__link {
|
||||
&__link {
|
||||
display: block;
|
||||
font-weight: bold;
|
||||
line-height: 1;
|
||||
|
@ -59,33 +58,34 @@ export default {
|
|||
margin-bottom: 0.375em;
|
||||
text-decoration: none;
|
||||
|
||||
&:hover ~ .nav__underline {
|
||||
&::before,
|
||||
&::after {
|
||||
&.router-link-exact-active {
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
&__link:hover ~ &__underline {
|
||||
&:before,
|
||||
&:after {
|
||||
width: 50%;
|
||||
background-color: $copy-color;
|
||||
}
|
||||
}
|
||||
|
||||
&.router-link-exact-active {
|
||||
color: $bg-color-light;
|
||||
&__link.router-link-exact-active ~ &__underline {
|
||||
&:before,
|
||||
&:after {
|
||||
width: 50%;
|
||||
background-color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
&:hover ~ .nav__underline {
|
||||
&::before,
|
||||
&::after {
|
||||
background-color: $bg-color-light;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.nav__underline {
|
||||
&__underline {
|
||||
position: relative;
|
||||
display: block;
|
||||
width: 100%;
|
||||
|
||||
&::before,
|
||||
&::after {
|
||||
&:before,
|
||||
&:after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
width: 0;
|
||||
|
@ -94,12 +94,13 @@ export default {
|
|||
transition: all 0.2s ease-in-out;
|
||||
}
|
||||
|
||||
&::before {
|
||||
&:before {
|
||||
left: 50%;
|
||||
}
|
||||
|
||||
&::after {
|
||||
&:after {
|
||||
right: 50%;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue