forked from lichess-org/lila
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_mselect.scss
More file actions
113 lines (91 loc) · 2.07 KB
/
_mselect.scss
File metadata and controls
113 lines (91 loc) · 2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
$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;
}
}
}