Skip to content

Commit 7a19039

Browse files
committed
style fix and css var updated
1 parent 75fc126 commit 7a19039

File tree

1 file changed

+44
-35
lines changed

1 file changed

+44
-35
lines changed

src/styles.css

Lines changed: 44 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
--menu-max-height: 400px;
77
--input-width: 300px;
88
--font-size: 16px;
9-
--border-radius: 8px;
10-
--transition: 200ms;
9+
--border-radius: 8px 8px 8px 8px;
1110
--active-menu-shadow: 1px 1px 5px 0px gray;
12-
--option-bg-hover: rgb(233, 233, 233);
1311
--line-height: 1.4;
12+
--active-menu-background: white;
13+
--active-menu-radius: var(--border-radius);
1414
}
1515

1616
.msl-wrp * {
@@ -36,38 +36,65 @@
3636
border-radius: var(--border-radius);
3737
outline: none;
3838
cursor: text;
39+
transition: border-radius 200ms;
3940
}
4041
.msl:not(.msl-active, .msl-active-up):hover {
4142
border-color: rgb(80, 80, 80);
4243
}
4344
.msl-active {
44-
background-color: white;
45+
background: var(--active-menu-background);
4546
box-shadow: var(--active-menu-shadow);
4647
z-index: 9999;
4748
border-color: transparent;
48-
border-radius: var(--border-radius) var(--border-radius) 0 0;
49+
border-radius: var(--active-menu-radius);
50+
border-bottom-left-radius: 0;
51+
border-bottom-right-radius: 0;
52+
border-bottom: 0;
53+
transition: border-top-left-radius 400ms, border-top-right-radius 400ms;
4954
}
5055
.msl-active-up {
51-
background-color: white;
56+
background: var(--active-menu-background);
5257
box-shadow: var(--active-menu-shadow);
5358
z-index: 9999;
5459
border-color: transparent;
55-
border-radius: 0 0 var(--border-radius) var(--border-radius);
60+
border-radius: var(--active-menu-radius);
61+
border-top-left-radius: 0;
62+
border-top-right-radius: 0;
63+
transition: border-bottom-left-radius 400ms, border-bottom-right-radius 400ms;
5664
}
5765
.msl-active ~ .msl-options {
66+
background: var(--active-menu-background);
5867
z-index: 9999;
5968
box-shadow: var(--active-menu-shadow);
6069
clip-path: inset(0px -10px -10px -10px);
6170
max-height: var(--menu-max-height);
62-
border-radius: 0 0 var(--border-radius) var(--border-radius);
71+
border-radius: var(--active-menu-radius);
72+
border-top-left-radius: 0;
73+
border-top-right-radius: 0;
74+
transition: border-bottom-left-radius 0.5s ease-in, border-bottom-right-radius 0.5s ease-in;
6375
}
6476
.msl-active-up ~ .msl-options {
77+
background: var(--active-menu-background);
6578
z-index: 9999;
6679
bottom: 99%;
6780
box-shadow: var(--active-menu-shadow);
6881
clip-path: inset(-10px -10px 0 -10px);
6982
max-height: var(--menu-max-height);
70-
border-radius: var(--border-radius) var(--border-radius) 0 0;
83+
border-radius: var(--active-menu-radius);
84+
border-bottom: 0;
85+
border-bottom-right-radius: 0;
86+
border-bottom-left-radius: 0;
87+
transition: border-top-left-radius 700ms, border-top-right-radius 700ms;
88+
}
89+
.msl-options {
90+
position: absolute;
91+
width: 100%;
92+
background: white;
93+
max-height: 0;
94+
overflow: auto;
95+
scrollbar-color: rgb(0, 0, 0, 0.1) transparent;
96+
scrollbar-width: thin;
97+
border-radius: var(--border-radius);
7198
}
7299
.msl-input-wrp {
73100
display: inline-block;
@@ -91,11 +118,11 @@
91118
}
92119
.msl-chip {
93120
background: rgb(238, 238, 238);
94-
border-radius: calc(var(--border-radius) - 3px);
121+
border-radius: 5px;
95122
margin: 5px;
96123
padding: 3px 3px 3px 6px;
97124
white-space: nowrap;
98-
font-size: calc(var(--font-size) - 3px);
125+
font-size: var(--font-size);
99126
display: inline-flex;
100127
align-items: center;
101128
line-break: anywhere;
@@ -112,15 +139,6 @@
112139
line-break: strict;
113140
white-space: nowrap;
114141
}
115-
.msl-options {
116-
position: absolute;
117-
width: 100%;
118-
background: white;
119-
max-height: 0;
120-
overflow: auto;
121-
scrollbar-color: rgb(0, 0, 0, 0.1) transparent;
122-
scrollbar-width: thin;
123-
}
124142
.msl-options::-webkit-scrollbar {
125143
width: 8px;
126144
}
@@ -139,7 +157,7 @@
139157
.msl-options .msl-option,
140158
.msl-grp-title {
141159
font-size: var(--font-size);
142-
border-radius: calc(var(--border-radius) - 3px);
160+
border-radius: 5px;
143161
padding: 7px 5px;
144162
cursor: pointer;
145163
margin: 4px 6px 4px;
@@ -168,7 +186,7 @@
168186
}
169187
.msl-options .msl-option:hover,
170188
.msl-option:focus {
171-
background: var(--option-bg-hover);
189+
background: rgb(233, 233, 233);
172190
}
173191
.msl-option-active {
174192
background: #e6f4fa;
@@ -199,26 +217,19 @@
199217
height: 25px;
200218
}
201219

202-
.msl-clear-btn .msl-close-icn {
203-
transform: scale(0.7);
204-
}
205-
206220
.msl-clear-btn:hover,
207221
.msl-arrow-btn:hover {
208222
background: lightgray;
209223
}
210224

211225
.msl-close-icn > line,
212226
.msl-arrow-icn > line {
213-
stroke-width: 1.2;
214-
stroke-linecap: round;
215-
stroke: rgb(0, 0, 0, 0.6);
227+
stroke-width: 1;
216228
}
217229

218230
.msl-arrow-icn {
219231
height: 20px;
220232
width: 20px;
221-
transform: scale(0.8);
222233
}
223234

224235
.msl-chip-delete {
@@ -228,19 +239,17 @@
228239
min-height: 20px;
229240
margin-left: 3px;
230241
background: rgb(218, 218, 218);
242+
color: rgb(0, 0, 0, 0.6);
231243
}
232244
.msl-chip-delete:hover {
233245
background: lightgray;
234246
}
235247

236-
.msl-chip-delete .msl-close-icn {
237-
transform: scale(0.6);
238-
}
239248
.msl-chip-delete .msl-close-icn > line {
240249
stroke-width: 1;
241250
}
242251

243252
.msl-close-icn {
244-
height: 15px;
245-
width: 15px;
253+
height: 10px;
254+
width: 10px;
246255
}

0 commit comments

Comments
 (0)