|
1 | 1 | :root { |
2 | | - --spacing-smaller: 3px; |
3 | | - --spacing-small: 5px; |
4 | | - --spacing-medium: 7px; |
5 | | - --spacing-large: 12px; |
6 | | - --font-size: 12px; |
7 | | - --font-size-large: 14px; |
8 | | - --font-size-larger: 16px; |
9 | | - --line-height: 16px; |
10 | | - --line-height-larger: 20px; |
| 2 | + --spacing-smaller: 0.1875rem; |
| 3 | + --spacing-small: 0.3125rem; |
| 4 | + --spacing-medium: 0.4375rem; |
| 5 | + --spacing-large: 0.75rem; |
| 6 | + --font-size: 0.75rem; |
| 7 | + --font-size-large: 0.875rem; |
| 8 | + --font-size-larger: 1rem; |
| 9 | + --line-height: 1rem; |
| 10 | + --line-height-larger: 1.25rem; |
11 | 11 | --primary-color: #40c979; |
| 12 | + --ms-bg: #ffffff; |
12 | 13 | --text-color-dark: #212529; |
13 | 14 | --text-color: #585858; |
14 | 15 | --text-color-light: #65727e; |
|
22 | 23 | --input-outline-invalid: rgba(219, 138, 138, 0.5); |
23 | 24 | --input-color: #e9e9ed; |
24 | 25 | --input-disabled: #f7f7f7; |
25 | | - --input-min-height: 45px; |
26 | | - --options-height: 40dvh; |
27 | 26 | --option-background: #f3f4f7; |
28 | | - --border-radius: 5px; |
29 | | - --icon-size: 12px; |
30 | | - --icon-space: 30px; |
31 | | - --checkbox-size: 16px; |
32 | | - --checkbox-radius: 4px; |
33 | 27 | --checkbox-border: #ced4da; |
34 | | - --checkbox-background: #fff; |
35 | | - --checkbox-active: #fff; |
36 | | - --checkbox-thickness: 2px; |
| 28 | + --checkbox-background: #ffffff; |
| 29 | + --checkbox-active: #ffffff; |
| 30 | + --input-min-height: 2.8125rem; |
| 31 | + --options-height: 40dvh; |
| 32 | + --border-radius: 0.3125rem; |
| 33 | + --icon-size: 0.75rem; |
| 34 | + --icon-space: 1.875rem; |
| 35 | + --checkbox-size: 1rem; |
| 36 | + --checkbox-radius: 0.25rem; |
| 37 | + --checkbox-thickness: 0.125rem; |
| 38 | +} |
| 39 | +.multi-select[data-theme="dark"] { |
| 40 | + --ms-bg: #2b2b2b; |
| 41 | + --text-color-dark: #f8f9fa; |
| 42 | + --text-color: #adb5bd; |
| 43 | + --text-color-light: #adb5bd; |
| 44 | + --border-color: #495057; |
| 45 | + --border-color-light: #495057; |
| 46 | + --input-background: #343a40; |
| 47 | + --input-border: #495057; |
| 48 | + --input-border-active: #6c757d; |
| 49 | + --option-background: #343a40; |
| 50 | + --checkbox-background: #2b2b2b; |
| 51 | + --checkbox-border: #6c757d; |
| 52 | + --checkbox-active: #ffffff; |
| 53 | + --input-disabled: #1e1e1e; |
| 54 | +} |
| 55 | +@media (prefers-color-scheme: dark) { |
| 56 | + .multi-select[data-theme="auto"] { |
| 57 | + --ms-bg: #2b2b2b; |
| 58 | + --text-color-dark: #f8f9fa; |
| 59 | + --text-color: #adb5bd; |
| 60 | + --text-color-light: #adb5bd; |
| 61 | + --border-color: #495057; |
| 62 | + --border-color-light: #495057; |
| 63 | + --input-background: #343a40; |
| 64 | + --input-border: #495057; |
| 65 | + --input-border-active: #6c757d; |
| 66 | + --option-background: #343a40; |
| 67 | + --checkbox-background: #2b2b2b; |
| 68 | + --checkbox-border: #6c757d; |
| 69 | + --checkbox-active: #ffffff; |
| 70 | + --input-disabled: #1e1e1e; |
| 71 | + } |
37 | 72 | } |
38 | 73 | .multi-select { |
39 | 74 | display: flex; |
|
44 | 79 | user-select: none; |
45 | 80 | } |
46 | 81 | .multi-select .multi-select-header { |
| 82 | + background-color: var(--ms-bg); |
47 | 83 | border: 1px solid var(--input-border); |
48 | 84 | border-radius: var(--border-radius); |
49 | 85 | padding: var(--spacing-medium) var(--spacing-large); |
|
57 | 93 | display: block; |
58 | 94 | position: absolute; |
59 | 95 | top: 50%; |
60 | | - right: 15px; |
| 96 | + right: 1rem; |
61 | 97 | transform: translateY(-50%); |
62 | 98 | background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23949ba3' viewBox='0 0 16 16'%3E%3Cpath d='M8 13.1l-8-8 2.1-2.2 5.9 5.9 5.9-5.9 2.1 2.2z'/%3E%3C/svg%3E"); |
63 | 99 | height: var(--icon-size); |
|
79 | 115 | display: inline-flex; |
80 | 116 | align-items: center; |
81 | 117 | background-color: var(--option-background); |
| 118 | + color: var(--text-color-dark); |
82 | 119 | font-size: var(--font-size-large); |
83 | 120 | padding: var(--spacing-smaller) var(--spacing-small); |
84 | 121 | border-radius: var(--border-radius); |
|
98 | 135 | z-index: 999; |
99 | 136 | margin-top: var(--spacing-small); |
100 | 137 | padding: var(--spacing-small); |
101 | | - background-color: #fff; |
| 138 | + background-color: var(--ms-bg); |
102 | 139 | border-radius: var(--border-radius); |
103 | | - box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); |
| 140 | + box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15); |
104 | 141 | max-height: var(--options-height); |
105 | 142 | overflow-y: auto; |
106 | 143 | overflow-x: hidden; |
107 | 144 | } |
108 | 145 | .multi-select .multi-select-options::-webkit-scrollbar { |
109 | | - width: 5px; |
| 146 | + width: 0.3125rem; |
110 | 147 | } |
111 | 148 | .multi-select .multi-select-options::-webkit-scrollbar-track { |
112 | | - background: #f0f1f3; |
| 149 | + background: var(--input-background); |
113 | 150 | } |
114 | 151 | .multi-select .multi-select-options::-webkit-scrollbar-thumb { |
115 | | - background: #cdcfd1; |
| 152 | + background: var(--border-color); |
116 | 153 | } |
117 | 154 | .multi-select .multi-select-options::-webkit-scrollbar-thumb:hover { |
118 | | - background: #b2b6b9; |
| 155 | + background: var(--input-placeholder); |
119 | 156 | } |
120 | 157 | .multi-select .multi-select-options .multi-select-option, |
121 | | -.multi-select .multi-select-options .multi-select-all { |
122 | | - padding: var(--spacing-large); |
| 158 | +.multi-select .multi-select-options .multi-select-all, |
| 159 | +.multi-select .multi-select-options .multi-select-group { |
| 160 | + padding: 0.5rem var(--spacing-large); |
| 161 | +} |
| 162 | +.multi-select .multi-select-options .multi-select-option[data-group]:not([data-group=""]) { |
| 163 | + padding-left: 2.5rem; |
123 | 164 | } |
124 | 165 | .multi-select .multi-select-options .multi-select-option .multi-select-option-radio, |
125 | | -.multi-select .multi-select-options .multi-select-all .multi-select-option-radio { |
| 166 | +.multi-select .multi-select-options .multi-select-all .multi-select-option-radio, |
| 167 | +.multi-select .multi-select-options .multi-select-group .multi-select-option-radio { |
126 | 168 | background: var(--checkbox-background); |
127 | 169 | margin-right: var(--spacing-large); |
128 | 170 | height: var(--checkbox-size); |
|
131 | 173 | border-radius: var(--checkbox-radius); |
132 | 174 | } |
133 | 175 | .multi-select .multi-select-options .multi-select-option .multi-select-option-text, |
134 | | -.multi-select .multi-select-options .multi-select-all .multi-select-option-text { |
| 176 | +.multi-select .multi-select-options .multi-select-all .multi-select-option-text, |
| 177 | +.multi-select .multi-select-options .multi-select-group .multi-select-option-text { |
135 | 178 | box-sizing: border-box; |
136 | 179 | flex: 1; |
137 | 180 | overflow: hidden; |
138 | 181 | text-overflow: ellipsis; |
139 | 182 | white-space: nowrap; |
140 | 183 | color: inherit; |
141 | 184 | font-size: var(--font-size-larger); |
142 | | - line-height: var(--line-height); |
| 185 | + line-height: var(--line-height-larger); |
| 186 | + padding-bottom: 1px; |
143 | 187 | } |
144 | 188 | .multi-select .multi-select-options .multi-select-option.multi-select-selected .multi-select-option-radio, |
145 | | -.multi-select .multi-select-options .multi-select-all.multi-select-selected .multi-select-option-radio { |
| 189 | +.multi-select .multi-select-options .multi-select-all.multi-select-selected .multi-select-option-radio, |
| 190 | +.multi-select .multi-select-options .multi-select-group.multi-select-selected .multi-select-option-radio { |
146 | 191 | border-color: var(--primary-color); |
147 | 192 | background-color: var(--primary-color); |
148 | 193 | } |
149 | 194 | .multi-select .multi-select-options .multi-select-option.multi-select-selected .multi-select-option-radio::after, |
150 | | -.multi-select .multi-select-options .multi-select-all.multi-select-selected .multi-select-option-radio::after { |
| 195 | +.multi-select .multi-select-options .multi-select-all.multi-select-selected .multi-select-option-radio::after, |
| 196 | +.multi-select .multi-select-options .multi-select-group.multi-select-selected .multi-select-option-radio::after { |
151 | 197 | content: ""; |
152 | 198 | display: block; |
153 | 199 | width: calc(var(--checkbox-size) / 4); |
|
157 | 203 | transform: rotate(45deg) translate(50%, -25%); |
158 | 204 | } |
159 | 205 | .multi-select .multi-select-options .multi-select-option.multi-select-selected .multi-select-option-text, |
160 | | -.multi-select .multi-select-options .multi-select-all.multi-select-selected .multi-select-option-text { |
| 206 | +.multi-select .multi-select-options .multi-select-all.multi-select-selected .multi-select-option-text, |
| 207 | +.multi-select .multi-select-options .multi-select-group.multi-select-selected .multi-select-option-text { |
161 | 208 | color: var(--text-color-dark); |
162 | 209 | } |
163 | | -.multi-select .multi-select-options .multi-select-option:hover, .multi-select .multi-select-options .multi-select-option:active, |
164 | | -.multi-select .multi-select-options .multi-select-all:hover, .multi-select .multi-select-options .multi-select-all:active { |
| 210 | +.multi-select .multi-select-options .multi-select-option:hover, |
| 211 | +.multi-select .multi-select-options .multi-select-option:active, |
| 212 | +.multi-select .multi-select-options .multi-select-all:hover, |
| 213 | +.multi-select .multi-select-options .multi-select-all:active, |
| 214 | +.multi-select .multi-select-options .multi-select-group:hover, |
| 215 | +.multi-select .multi-select-options .multi-select-group:active { |
165 | 216 | background-color: var(--option-background); |
166 | 217 | } |
167 | 218 | .multi-select .multi-select-options .multi-select-all { |
168 | 219 | border-bottom: 1px solid var(--border-color-light); |
169 | 220 | border-radius: 0; |
170 | 221 | } |
| 222 | +.multi-select .multi-select-options .multi-select-group { |
| 223 | + font-weight: bold; |
| 224 | + border-radius: 0; |
| 225 | +} |
171 | 226 | .multi-select .multi-select-options .multi-select-search { |
172 | 227 | padding: var(--spacing-medium) var(--spacing-large); |
173 | 228 | border: 1px solid var(--input-border); |
174 | 229 | border-radius: var(--border-radius); |
175 | | - margin: 10px 10px 5px 10px; |
176 | | - width: 100%; |
| 230 | + margin: 0.625rem; |
| 231 | + width: calc(100% - 1.25rem); |
177 | 232 | outline: none; |
178 | 233 | font-size: var(--font-size-larger); |
| 234 | + background-color: var(--ms-bg); |
| 235 | + color: var(--text-color-dark); |
179 | 236 | } |
180 | 237 | .multi-select .multi-select-options .multi-select-search::placeholder { |
181 | 238 | color: var(--text-color-light); |
182 | 239 | } |
183 | 240 | .multi-select .multi-select-header, |
184 | 241 | .multi-select .multi-select-option, |
185 | | -.multi-select .multi-select-all { |
| 242 | +.multi-select .multi-select-all, |
| 243 | +.multi-select .multi-select-group { |
186 | 244 | display: flex; |
187 | 245 | flex-wrap: wrap; |
188 | 246 | box-sizing: border-box; |
|
0 commit comments