mirror of
https://github.com/lichess-org/lila.git
synced 2026-05-26 13:51:00 +00:00
114 lines
2.1 KiB
SCSS
114 lines
2.1 KiB
SCSS
$c-mselect: $c-primary;
|
|
|
|
.mselect {
|
|
position: relative;
|
|
white-space: nowrap;
|
|
|
|
&__toggle {
|
|
position: absolute;
|
|
z-index: -1;
|
|
opacity: 0;
|
|
}
|
|
|
|
&__label {
|
|
@extend %box-radius, %flex-between-nowrap, %metal-with-border;
|
|
@include backdrop-blur-if-transparent;
|
|
@include padding-direction(0.3rem, 0.6rem, 0.3rem, 1rem);
|
|
|
|
gap: 1ch;
|
|
cursor: pointer;
|
|
|
|
&::after {
|
|
@extend %data-icon;
|
|
|
|
content: $licon-MoreTriangle;
|
|
font-size: 70%;
|
|
color: $c-mselect;
|
|
margin-inline: 0.4em 0;
|
|
}
|
|
|
|
&:focus-visible {
|
|
outline: $outline;
|
|
}
|
|
}
|
|
|
|
&__toggle:checked ~ .mselect__label {
|
|
@include transition(opacity);
|
|
|
|
opacity: 0;
|
|
}
|
|
|
|
&__toggle:focus-visible ~ .mselect__label {
|
|
outline: $outline;
|
|
}
|
|
|
|
&__list {
|
|
@extend %base-font, %box-radius, %popup-shadow, %flex-column;
|
|
@include inline-start(0);
|
|
@include transition(transform);
|
|
|
|
position: absolute;
|
|
top: 0;
|
|
min-width: 100%;
|
|
max-height: 60vh;
|
|
overflow-y: auto;
|
|
z-index: $z-mselect-111;
|
|
background: $c-bg-popup;
|
|
transform: scale(1, 0);
|
|
transform-origin: top;
|
|
|
|
.mselect__toggle:checked ~ & {
|
|
transform: scale(1, 1);
|
|
|
|
@media (width <= $small) {
|
|
position: fixed;
|
|
top: 50%;
|
|
transform: translateY(-50%) scale(1, 1);
|
|
|
|
dialog & {
|
|
position: absolute;
|
|
top: 0;
|
|
transform: scale(1, 1);
|
|
}
|
|
}
|
|
|
|
* {
|
|
opacity: 1;
|
|
visibility: visible;
|
|
transition: opacity 125ms ease-in-out 125ms;
|
|
}
|
|
}
|
|
}
|
|
|
|
&__item {
|
|
white-space: nowrap;
|
|
display: block;
|
|
padding: 0.3em 1em;
|
|
visibility: hidden;
|
|
opacity: 0;
|
|
color: $c-mselect;
|
|
border-left: 3px solid transparent;
|
|
|
|
@include transition(background-color border-color);
|
|
|
|
&.current {
|
|
background: $c-bg-zebra;
|
|
border-color: $c-mselect;
|
|
}
|
|
|
|
&:hover {
|
|
background: $c-mselect;
|
|
color: $c-over;
|
|
}
|
|
|
|
&:focus-visible {
|
|
outline: $outline;
|
|
outline-offset: -2px;
|
|
}
|
|
|
|
&::before {
|
|
margin-inline-end: 0.4em;
|
|
}
|
|
}
|
|
}
|