|
4 | 4 | }
|
5 | 5 | .msl-vars {
|
6 | 6 | --menu-max-height: 400px;
|
| 7 | + --input-width: 300px; |
7 | 8 | --font-size: 16px;
|
8 |
| - --border-radius: 7px; |
| 9 | + --border-radius: 8px; |
9 | 10 | --transition: 200ms;
|
10 |
| - --menu-shadow: 1px 1px 5px 0px gray; |
| 11 | + --active-menu-shadow: 1px 1px 5px 0px gray; |
11 | 12 | --option-bg-hover: rgb(233, 233, 233);
|
| 13 | + --line-height: 1.4; |
| 14 | +} |
| 15 | + |
| 16 | +.msl-wrp * { |
| 17 | + line-height: var(--line-height); |
12 | 18 | }
|
13 | 19 |
|
14 | 20 | .msl-wrp {
|
| 21 | + width: var(--input-width); |
| 22 | + outline: none; |
15 | 23 | position: relative;
|
16 | 24 | border-radius: var(--border-radius);
|
17 | 25 | }
|
|
29 | 37 | outline: none;
|
30 | 38 | cursor: text;
|
31 | 39 | }
|
32 |
| -.msl:not(.msl-active):hover { |
| 40 | +.msl:not(.msl-active, .msl-active-up):hover { |
33 | 41 | border-color: rgb(80, 80, 80);
|
34 | 42 | }
|
35 | 43 | .msl-active {
|
36 | 44 | background-color: white;
|
37 |
| - box-shadow: var(--menu-shadow); |
38 |
| - z-index: 999; |
| 45 | + box-shadow: var(--active-menu-shadow); |
| 46 | + z-index: 9999; |
39 | 47 | border-color: transparent;
|
40 | 48 | border-radius: var(--border-radius) var(--border-radius) 0 0;
|
41 | 49 | }
|
| 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 | +} |
42 | 57 | .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); |
45 | 60 | clip-path: inset(0px -10px -10px -10px);
|
46 | 61 | 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; |
47 | 71 | }
|
48 | 72 | .msl-input-wrp {
|
49 | 73 | display: inline-block;
|
|
54 | 78 | vertical-align: top;
|
55 | 79 | outline: none;
|
56 | 80 | margin: 5px;
|
57 |
| - line-height: 1; |
58 | 81 | padding: 3px;
|
59 | 82 | font-size: var(--font-size);
|
60 | 83 | }
|
61 | 84 |
|
62 | 85 | .msl-input::before {
|
63 |
| - line-height: 1; |
| 86 | + line-height: var(--line-height); |
64 | 87 | color: rgb(146, 146, 146);
|
65 | 88 | }
|
66 | 89 | .msl-input[data-placeholder]:not([data-placeholder=""]):empty::before {
|
|
92 | 115 | .msl-options {
|
93 | 116 | position: absolute;
|
94 | 117 | width: 100%;
|
95 |
| - border-radius: 0 0 var(--border-radius) var(--border-radius); |
96 | 118 | background: white;
|
97 | 119 | max-height: 0;
|
98 | 120 | overflow: auto;
|
| 121 | + scrollbar-color: rgb(0, 0, 0, 0.1) transparent; |
| 122 | + scrollbar-width: thin; |
99 | 123 | }
|
100 | 124 | .msl-options::-webkit-scrollbar {
|
101 | 125 | width: 8px;
|
|
120 | 144 | cursor: pointer;
|
121 | 145 | margin: 4px 6px 4px;
|
122 | 146 | line-break: anywhere;
|
123 |
| - line-height: 1.2; |
| 147 | + line-height: var(--line-height); |
124 | 148 | outline: none;
|
125 | 149 | white-space: break-spaces;
|
126 | 150 | transition: background 200ms;
|
127 | 151 | }
|
| 152 | + |
| 153 | +.msl-wrp:focus-visible, |
128 | 154 | .msl-option:focus-visible,
|
129 | 155 | .msl-btn:focus-visible {
|
130 | 156 | outline: 2px solid rgb(0, 119, 255);
|
|
171 | 197 | .msl-clear-btn {
|
172 | 198 | width: 25px;
|
173 | 199 | height: 25px;
|
174 |
| - transition: transform var(--transition); |
175 | 200 | }
|
176 | 201 |
|
177 | 202 | .msl-clear-btn .msl-close-icn {
|
|
0 commit comments