Refactor .menu-item style

This commit is contained in:
Mimi 2024-04-17 01:30:15 +08:00
parent 2195b01d8c
commit 6bf97f6e49
5 changed files with 14 additions and 13 deletions

View File

@ -36,18 +36,8 @@
}
.badge {
display: inline-block;
font-weight: bold;
line-height: 1;
margin-left: .35em;
margin-top: .35em;
text-align: center;
white-space: nowrap;
+mobile() {
float: right;
margin-left: 0;
}
}
}

View File

@ -272,3 +272,12 @@ gemini-block-not-first() {
margin-top: $content-mobile-padding;
}
}
menu-item-row() {
display: flex;
align-items: center;
.badge {
margin-left: auto;
}
}

View File

@ -31,6 +31,7 @@
+mobile() {
text-align: left;
menu-item-row();
}
}
@ -38,6 +39,7 @@
background: white;
border-radius: 10px;
color: $black-light;
margin-left: .35em;
padding: 1px 4px;
text-shadow: 1px 1px 0 rgba(0, 0, 0, .1);
}

View File

@ -27,6 +27,7 @@
+mobile() {
padding: 5px 10px;
menu-item-row();
}
&:hover, &.menu-item-active {
@ -51,6 +52,7 @@
.badge {
background: $gainsboro;
color: $black-light;
margin-left: .35em;
padding: 1px 4px;
}
}

View File

@ -10,9 +10,8 @@
a {
padding: 5px 20px;
position: relative;
text-align: left;
transition-property: background-color;
menu-item-row();
}
+tablet-mobile() {
@ -25,7 +24,6 @@
background: $grey-light;
border-radius: 10px;
color: var(--content-bg-color);
float: right;
padding: 2px 5px;
text-shadow: 1px 1px 0 rgba(0, 0, 0, .1);
}