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 ;
11+ --primary-color : # 40c979 ;
12+ --text-color-dark : # 212529 ;
13+ --text-color : # 585858 ;
14+ --text-color-light : # 65727e ;
15+ --border-color : # bebebe ;
16+ --border-color-light : # f1f3f5 ;
17+ --input-placeholder : # 65727e ;
18+ --input-background : # e9e9ed ;
19+ --input-border : # dee2e6 ;
20+ --input-border-active : # c1c9d0 ;
21+ --input-color : # e9e9ed ;
22+ --input-min-height : 45px ;
23+ --options-height : 40dvh ;
24+ --option-background : # f3f4f7 ;
25+ --border-radius : 5px ;
26+ --icon-size : 12px ;
27+ --icon-space : 30px ;
28+ --checkbox-size : 16px ;
29+ --checkbox-radius : 4px ;
30+ --checkbox-border : # ced4da ;
31+ --checkbox-background : # fff ;
32+ --checkbox-active : # fff ;
33+ --checkbox-thickness : 2px ;
34+ }
35+
136.multi-select {
237 display : flex;
338 box-sizing : border-box;
641 width : 100% ;
742 user-select : none;
843}
44+
945.multi-select .multi-select-header {
10- border : 1px solid # dee2e6 ;
11- padding : 7px 30px 7px 12px ;
46+ border : 1px solid var (--input-border );
47+ border-radius : var (--border-radius );
48+ padding : var (--spacing-medium ) var (--spacing-large );
49+ padding-right : var (--icon-space );
1250 overflow : hidden;
13- gap : 7 px ;
14- min-height : 45 px ;
51+ gap : var ( --spacing-medium ) ;
52+ min-height : var ( --input-min-height ) ;
1553}
54+
1655.multi-select .multi-select-header ::after {
1756 content : "" ;
1857 display : block;
2160 right : 15px ;
2261 transform : translateY (-50% );
2362 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" );
24- height : 12 px ;
25- width : 12 px ;
63+ height : var ( --icon-size ) ;
64+ width : var ( --icon-size ) ;
2665}
66+
2767.multi-select .multi-select-header .multi-select-header-active {
28- border-color : # c1c9d0 ;
68+ border-color : var ( --input-border-active ) ;
2969}
70+
3071.multi-select .multi-select-header .multi-select-header-active ::after {
3172 transform : translateY (-50% ) rotate (180deg );
3273}
74+
3375.multi-select .multi-select-header .multi-select-header-active + .multi-select-options {
3476 display : flex;
3577}
78+
3679.multi-select .multi-select-header .multi-select-header-placeholder {
37- color : # 65727e ;
80+ color : var ( --text-color-light ) ;
3881}
82+
3983.multi-select .multi-select-header .multi-select-header-option {
4084 display : inline-flex;
4185 align-items : center;
42- background-color : # f3f4f7 ;
43- font-size : 14 px ;
44- padding : 3 px 8 px ;
45- border-radius : 5 px ;
86+ background-color : var ( --option-background ) ;
87+ font-size : var ( --font-size-large ) ;
88+ padding : var ( --spacing-smaller ) var ( --spacing-small ) ;
89+ border-radius : var ( --border-radius ) ;
4690}
91+
4792.multi-select .multi-select-header .multi-select-header-max {
48- font-size : 14 px ;
49- color : # 65727e ;
93+ font-size : var ( --font-size-large ) ;
94+ color : var ( --text-color-light ) ;
5095}
96+
5197.multi-select .multi-select-options {
5298 display : none;
5399 box-sizing : border-box;
57103 left : 0 ;
58104 right : 0 ;
59105 z-index : 999 ;
60- margin-top : 5 px ;
61- padding : 5 px ;
106+ margin-top : var ( --spacing-small ) ;
107+ padding : var ( --spacing-small ) ;
62108 background-color : # fff ;
63- border-radius : 5 px ;
109+ border-radius : var ( --border-radius ) ;
64110 box-shadow : 0 0 10px rgba (0 , 0 , 0 , 0.1 );
65- max-height : 200 px ;
111+ max-height : var ( --options-height ) ;
66112 overflow-y : auto;
67113 overflow-x : hidden;
68114}
115+
69116.multi-select .multi-select-options ::-webkit-scrollbar {
70117 width : 5px ;
71118}
119+
72120.multi-select .multi-select-options ::-webkit-scrollbar-track {
73121 background : # f0f1f3 ;
74122}
123+
75124.multi-select .multi-select-options ::-webkit-scrollbar-thumb {
76125 background : # cdcfd1 ;
77126}
127+
78128.multi-select .multi-select-options ::-webkit-scrollbar-thumb : hover {
79129 background : # b2b6b9 ;
80130}
81- .multi-select .multi-select-options .multi-select-option , .multi-select .multi-select-options .multi-select-all {
82- padding : 4px 12px ;
83- height : 42px ;
84- }
85- .multi-select .multi-select-options .multi-select-option .multi-select-option-radio , .multi-select .multi-select-options .multi-select-all .multi-select-option-radio {
86- margin-right : 14px ;
87- height : 16px ;
88- width : 16px ;
89- border : 1px solid # ced4da ;
90- border-radius : 4px ;
91- }
92- .multi-select .multi-select-options .multi-select-option .multi-select-option-text , .multi-select .multi-select-options .multi-select-all .multi-select-option-text {
131+
132+ .multi-select .multi-select-options .multi-select-option ,
133+ .multi-select .multi-select-options .multi-select-all {
134+ padding : var (--spacing-large );
135+ }
136+
137+ .multi-select .multi-select-options .multi-select-option .multi-select-option-radio ,
138+ .multi-select .multi-select-options .multi-select-all .multi-select-option-radio {
139+ background : var (--checkbox-background );
140+ margin-right : var (--spacing-large );
141+ height : var (--checkbox-size );
142+ width : var (--checkbox-size );
143+ border : 1px solid var (--checkbox-border );
144+ border-radius : var (--checkbox-radius );
145+ }
146+
147+ .multi-select .multi-select-options .multi-select-option .multi-select-option-text ,
148+ .multi-select .multi-select-options .multi-select-all .multi-select-option-text {
93149 box-sizing : border-box;
94150 flex : 1 ;
95151 overflow : hidden;
96152 text-overflow : ellipsis;
97153 white-space : nowrap;
98154 color : inherit;
99- font-size : 16px ;
100- line-height : 20px ;
101- }
102- .multi-select .multi-select-options .multi-select-option .multi-select-selected .multi-select-option-radio , .multi-select .multi-select-options .multi-select-all .multi-select-selected .multi-select-option-radio {
103- border-color : # 40c979 ;
104- background-color : # 40c979 ;
105- }
106- .multi-select .multi-select-options .multi-select-option .multi-select-selected .multi-select-option-radio ::after , .multi-select .multi-select-options .multi-select-all .multi-select-selected .multi-select-option-radio ::after {
155+ font-size : var (--font-size-larger );
156+ line-height : var (--line-height );
157+ }
158+
159+ .multi-select .multi-select-options .multi-select-option .multi-select-selected .multi-select-option-radio ,
160+ .multi-select .multi-select-options .multi-select-all .multi-select-selected .multi-select-option-radio {
161+ border-color : var (--primary-color );
162+ background-color : var (--primary-color );
163+ }
164+
165+ .multi-select .multi-select-options .multi-select-option .multi-select-selected .multi-select-option-radio ::after ,
166+ .multi-select .multi-select-options .multi-select-all .multi-select-selected .multi-select-option-radio ::after {
107167 content : "" ;
108168 display : block;
109- width : 3px ;
110- height : 7px ;
111- margin : 0.12em 0 0 0.27em ;
112- border : solid # fff ;
113- border-width : 0 0.15em 0.15em 0 ;
114- transform : rotate (45deg );
115- }
116- .multi-select .multi-select-options .multi-select-option .multi-select-selected .multi-select-option-text , .multi-select .multi-select-options .multi-select-all .multi-select-selected .multi-select-option-text {
117- color : # 40c979 ;
118- }
119- .multi-select .multi-select-options .multi-select-option : hover , .multi-select .multi-select-options .multi-select-option : active , .multi-select .multi-select-options .multi-select-all : hover , .multi-select .multi-select-options .multi-select-all : active {
120- background-color : # f3f4f7 ;
121- }
169+ width : calc (var (--checkbox-size ) / 4 );
170+ height : calc (var (--checkbox-size ) / 2 );
171+ border : solid var (--checkbox-active );
172+ border-width : 0 var (--checkbox-thickness ) var (--checkbox-thickness ) 0 ;
173+ transform : rotate (45deg ) translate (50% , -25% );
174+ }
175+
176+ .multi-select .multi-select-options .multi-select-option .multi-select-selected .multi-select-option-text ,
177+ .multi-select .multi-select-options .multi-select-all .multi-select-selected .multi-select-option-text {
178+ color : var (--text-color-dark );
179+ }
180+
181+ .multi-select .multi-select-options .multi-select-option : hover , .multi-select .multi-select-options .multi-select-option : active ,
182+ .multi-select .multi-select-options .multi-select-all : hover , .multi-select .multi-select-options .multi-select-all : active {
183+ background-color : var (--option-background );
184+ }
185+
122186.multi-select .multi-select-options .multi-select-all {
123- border-bottom : 1px solid # f1f3f5 ;
187+ border-bottom : 1px solid var ( --border-color-light ) ;
124188 border-radius : 0 ;
125189}
190+
126191.multi-select .multi-select-options .multi-select-search {
127- padding : 7 px 10 px ;
128- border : 1px solid # dee2e6 ;
129- border-radius : 5 px ;
192+ padding : var ( --spacing-medium ) var ( --spacing-large ) ;
193+ border : 1px solid var ( --input-border ) ;
194+ border-radius : var ( --border-radius ) ;
130195 margin : 10px 10px 5px 10px ;
131196 width : 100% ;
132197 outline : none;
133- font-size : 16 px ;
198+ font-size : var ( --font-size-larger ) ;
134199}
200+
135201.multi-select .multi-select-options .multi-select-search ::placeholder {
136- color : # b2b5b9 ;
202+ color : var ( --text-color-light ) ;
137203}
138- .multi-select .multi-select-header , .multi-select .multi-select-option , .multi-select .multi-select-all {
204+
205+ .multi-select .multi-select-header ,
206+ .multi-select .multi-select-option ,
207+ .multi-select .multi-select-all {
139208 display : flex;
140209 flex-wrap : wrap;
141210 box-sizing : border-box;
142211 align-items : center;
143- border-radius : 5 px ;
212+ border-radius : var ( --border-radius ) ;
144213 cursor : pointer;
145214 display : flex;
146215 align-items : center;
147216 width : 100% ;
148- font-size : 16 px ;
149- color : # 212529 ;
217+ font-size : var ( --font-size-larger ) ;
218+ color : var ( --text-color-dark ) ;
150219}
0 commit comments