Skip to content

Commit 977fb51

Browse files
committed
Update styles.css
1 parent 70e2990 commit 977fb51

File tree

1 file changed

+37
-12
lines changed

1 file changed

+37
-12
lines changed

src/styles.css

Lines changed: 37 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,22 @@
44
}
55
.msl-vars {
66
--menu-max-height: 400px;
7+
--input-width: 300px;
78
--font-size: 16px;
8-
--border-radius: 7px;
9+
--border-radius: 8px;
910
--transition: 200ms;
10-
--menu-shadow: 1px 1px 5px 0px gray;
11+
--active-menu-shadow: 1px 1px 5px 0px gray;
1112
--option-bg-hover: rgb(233, 233, 233);
13+
--line-height: 1.4;
14+
}
15+
16+
.msl-wrp * {
17+
line-height: var(--line-height);
1218
}
1319

1420
.msl-wrp {
21+
width: var(--input-width);
22+
outline: none;
1523
position: relative;
1624
border-radius: var(--border-radius);
1725
}
@@ -29,21 +37,37 @@
2937
outline: none;
3038
cursor: text;
3139
}
32-
.msl:not(.msl-active):hover {
40+
.msl:not(.msl-active, .msl-active-up):hover {
3341
border-color: rgb(80, 80, 80);
3442
}
3543
.msl-active {
3644
background-color: white;
37-
box-shadow: var(--menu-shadow);
38-
z-index: 999;
45+
box-shadow: var(--active-menu-shadow);
46+
z-index: 9999;
3947
border-color: transparent;
4048
border-radius: var(--border-radius) var(--border-radius) 0 0;
4149
}
50+
.msl-active-up {
51+
background-color: white;
52+
box-shadow: var(--active-menu-shadow);
53+
z-index: 9999;
54+
border-color: transparent;
55+
border-radius: 0 0 var(--border-radius) var(--border-radius);
56+
}
4257
.msl-active ~ .msl-options {
43-
z-index: 999;
44-
box-shadow: var(--menu-shadow);
58+
z-index: 9999;
59+
box-shadow: var(--active-menu-shadow);
4560
clip-path: inset(0px -10px -10px -10px);
4661
max-height: var(--menu-max-height);
62+
border-radius: 0 0 var(--border-radius) var(--border-radius);
63+
}
64+
.msl-active-up ~ .msl-options {
65+
z-index: 9999;
66+
bottom: 99%;
67+
box-shadow: var(--active-menu-shadow);
68+
clip-path: inset(-10px -10px 0 -10px);
69+
max-height: var(--menu-max-height);
70+
border-radius: var(--border-radius) var(--border-radius) 0 0;
4771
}
4872
.msl-input-wrp {
4973
display: inline-block;
@@ -54,13 +78,12 @@
5478
vertical-align: top;
5579
outline: none;
5680
margin: 5px;
57-
line-height: 1;
5881
padding: 3px;
5982
font-size: var(--font-size);
6083
}
6184

6285
.msl-input::before {
63-
line-height: 1;
86+
line-height: var(--line-height);
6487
color: rgb(146, 146, 146);
6588
}
6689
.msl-input[data-placeholder]:not([data-placeholder=""]):empty::before {
@@ -92,10 +115,11 @@
92115
.msl-options {
93116
position: absolute;
94117
width: 100%;
95-
border-radius: 0 0 var(--border-radius) var(--border-radius);
96118
background: white;
97119
max-height: 0;
98120
overflow: auto;
121+
scrollbar-color: rgb(0, 0, 0, 0.1) transparent;
122+
scrollbar-width: thin;
99123
}
100124
.msl-options::-webkit-scrollbar {
101125
width: 8px;
@@ -120,11 +144,13 @@
120144
cursor: pointer;
121145
margin: 4px 6px 4px;
122146
line-break: anywhere;
123-
line-height: 1.2;
147+
line-height: var(--line-height);
124148
outline: none;
125149
white-space: break-spaces;
126150
transition: background 200ms;
127151
}
152+
153+
.msl-wrp:focus-visible,
128154
.msl-option:focus-visible,
129155
.msl-btn:focus-visible {
130156
outline: 2px solid rgb(0, 119, 255);
@@ -171,7 +197,6 @@
171197
.msl-clear-btn {
172198
width: 25px;
173199
height: 25px;
174-
transition: transform var(--transition);
175200
}
176201

177202
.msl-clear-btn .msl-close-icn {

0 commit comments

Comments
 (0)