UNPKG

11.1 kBSCSSView Raw
1@import "mixins";
2
3$ng-select-highlight: #3f51b5 !default;
4$ng-select-primary-text: rgba(black, 0.87) !default;
5$ng-select-primary-light-text: rgba(white, 0.87) !default;
6$ng-select-secondary-text: rgba(black, 0.54) !default;
7$ng-select-secondary-light-text: rgba(white, 0.54) !default;
8$ng-select-disabled-text: rgba(black, 0.38) !default;
9$ng-select-divider: rgba(black, 0.12) !default;
10$ng-select-bg: #ffffff !default;
11
12.ng-select {
13 padding-bottom: 1.25em;
14 &.ng-select-disabled {
15 .ng-select-container {
16 &:after {
17 border-bottom-color: transparent;
18 background-image: linear-gradient(to right, rgba(0, 0, 0, 0.42) 0%, rgba(0, 0, 0, 0.42) 33%, transparent 0%);
19 background-size: 4px 1px;
20 background-repeat: repeat-x;
21 }
22 .ng-value-container {
23 .ng-value {
24 color: $ng-select-disabled-text;
25 }
26 .ng-placeholder {
27 color: $ng-select-disabled-text;
28 }
29 }
30 }
31 .ng-arrow-wrapper .ng-arrow,
32 .ng-clear-wrapper {
33 color: $ng-select-disabled-text;
34 }
35 }
36 &.ng-select-focused {
37 .ng-select-container {
38 &:after {
39 border-color: $ng-select-highlight;
40 border-width: 2px;
41 }
42 &.ng-appearance-outline {
43 &:after,
44 &:hover:after {
45 border-color: $ng-select-highlight;
46 border-width: 2px;
47 }
48 }
49 .ng-value-container .ng-placeholder {
50 transform: translateY(-1.28125em) scale(.75) perspective(100px) translateZ(.001px);
51 color: $ng-select-highlight;
52 }
53 .ng-arrow-wrapper .ng-arrow {
54 color: $ng-select-highlight;
55 }
56 }
57 }
58 .ng-has-value,
59 &.ng-select-filtered .ng-select-container {
60 .ng-placeholder {
61 display: initial;
62 }
63 }
64 .ng-has-value,
65 &.ng-select-opened {
66 .ng-placeholder {
67 transform: translateY(-1.28125em) scale(.75) perspective(100px) translateZ(.001px);
68 }
69 }
70 .ng-select-container {
71 color: $ng-select-primary-text;
72 align-items: baseline;
73 min-height: 51.5px;
74 &:after {
75 border-bottom: thin solid rgba(0, 0, 0, .42);
76 content: '';
77 bottom: 0;
78 left: 0;
79 right: 0;
80 position: absolute;
81 transition: border-color .3s cubic-bezier(.55, 0, .55, .2);
82 }
83 &.ng-appearance-outline {
84 padding: 0 .5em;
85 min-height: 60px;
86 &:after {
87 border: solid 1px $ng-select-divider;
88 border-radius: 5px;
89 height: calc(100% - .5em);
90 pointer-events: none;
91 transition: border-color .3s cubic-bezier(.25, .8, .25, 1);
92 }
93 &:hover:after {
94 border-color: $ng-select-primary-text;
95 border-width: 2px;
96 }
97 .ng-placeholder {
98 padding: 0 .25em;
99 background-color: $ng-select-bg;
100 z-index: 1;
101 }
102 .ng-value {
103 padding-left: .25em;
104 }
105 }
106 .ng-value-container {
107 align-items: stretch;
108 padding: .4375em 0;
109 border-top: .84375em solid transparent;
110 .ng-placeholder {
111 position: absolute;
112 color: $ng-select-secondary-text;
113 transform-origin: left 0;
114 transition: transform .4s cubic-bezier(.25, .8, .25, 1), color .4s cubic-bezier(.25, .8, .25, 1), width .4s cubic-bezier(.25, .8, .25, 1);
115 @include rtl {
116 transform-origin: right 0;
117 }
118 }
119 .ng-input {
120 bottom: .4375em;
121 }
122 }
123 }
124 &.ng-select-single {
125 .ng-select-container {
126 &.ng-appearance-outline {
127 .ng-arrow-wrapper {
128 bottom: 17px;
129 }
130 .ng-clear-wrapper {
131 bottom: 14px;
132 }
133 }
134 .ng-arrow-wrapper {
135 align-self: flex-end;
136 bottom: 9px;
137 }
138 .ng-clear-wrapper {
139 align-self: flex-end;
140 bottom: 7px;
141 }
142 }
143 }
144 &.ng-select-multiple {
145 &.ng-select-disabled {
146 .ng-select-container .ng-value-container .ng-value {
147 background-color: $ng-select-divider;
148 color: rgba(0, 0, 0, .26);
149 }
150 .ng-appearance-outline {
151 &:after,
152 &:hover:after {
153 background-image: none;
154 border: dotted 1px $ng-select-divider;
155 }
156 }
157 }
158 .ng-select-container {
159 &.ng-appearance-outline {
160 &.ng-has-value {
161 .ng-arrow-wrapper,
162 .ng-clear-wrapper {
163 border-top: none;
164 }
165 }
166 .ng-arrow-wrapper {
167 top: 0;
168 }
169 .ng-clear-wrapper {
170 top: 4px;
171 }
172 }
173 .ng-value-container {
174 .ng-value {
175 background-color: $ng-select-highlight;
176 border-radius: 2px;
177 color: $ng-select-bg;
178 padding: 2px 5px;
179 margin: 0 0.4375em 0.4375em 0;
180 @include rtl {
181 margin: 0 0 0.4375em 0.4375em;
182 }
183 &.ng-value-disabled {
184 background-color: $ng-select-divider;
185 color: rgba(0, 0, 0, .26);
186 }
187 .ng-value-label {
188 font-size: 14px;
189 font-weight: 500
190 }
191 .ng-value-icon {
192 color: $ng-select-secondary-light-text;
193 padding-right: 5px;
194 @include rtl {
195 padding-left: 5px;
196 padding-right: 0;
197 }
198 &:hover {
199 color: $ng-select-primary-light-text;
200 }
201 }
202 }
203 .ng-input {
204 line-height: 1.375em;
205 }
206 }
207 &.ng-has-value {
208 align-items: center;
209 .ng-value-container {
210 padding-bottom: 0;
211 padding-top: .1875em;
212 }
213 .ng-clear-wrapper,
214 .ng-arrow-wrapper {
215 border-top: .84375em solid transparent;
216 }
217 }
218 }
219 }
220 .ng-clear-wrapper {
221 color: $ng-select-secondary-text;
222 &:hover {
223 color: $ng-select-primary-text;
224 }
225 }
226 .ng-arrow-wrapper {
227 bottom: 2px;
228 .ng-arrow {
229 border-left: 5px solid transparent;
230 border-right: 5px solid transparent;
231 border-top: 5px solid;
232 margin: 0 4px;
233 color: $ng-select-secondary-text;
234 }
235 }
236 .ng-spinner-zone {
237 top: 3px;
238 }
239}
240
241.ng-dropdown-panel {
242 background: $ng-select-bg;
243 left: 0;
244 &.ng-select-top {
245 bottom: calc(100% - .84375em);
246 box-shadow: 0 -5px 5px -3px rgba(0, 0, 0, .2), 0 -8px 10px 1px rgba(0, 0, 0, .14), 0 -3px 14px 2px $ng-select-divider;
247 }
248 &.ng-select-right {
249 left: 100%;
250 top: calc(0% + .84375em);
251 box-shadow: 0 -5px 5px -3px rgba(0, 0, 0, .2), 0 -8px 10px 1px rgba(0, 0, 0, .14), 0 -3px 14px 2px $ng-select-divider;
252 margin-left: 4px;
253 }
254 &.ng-select-bottom {
255 top: calc(100% - 1.25em);
256 box-shadow: 0 5px 5px -3px rgba(0, 0, 0, .2), 0 8px 10px 1px rgba(0, 0, 0, .14), 0 3px 14px 2px $ng-select-divider;
257 }
258 &.ng-select-left {
259 left: calc(-100% - 4px);
260 top: calc(0% + .84375em);
261 box-shadow: 0 -5px 5px -3px rgba(0, 0, 0, .2), 0 -8px 10px 1px rgba(0, 0, 0, .14), 0 -3px 14px 2px $ng-select-divider;
262 }
263 &.multiple {
264 .ng-option {
265 &.selected {
266 background: $ng-select-bg;
267 }
268 &.marked {
269 background: rgba(0, 0, 0, .04);
270 }
271 }
272 }
273 .ng-dropdown-header {
274 border-bottom: 1px solid $ng-select-divider;
275 padding: 0 16px;
276 line-height: 3em;
277 min-height: 3em;
278 }
279 .ng-dropdown-footer {
280 border-top: 1px solid $ng-select-divider;
281 padding: 0 16px;
282 line-height: 3em;
283 min-height: 3em;
284 }
285 .ng-dropdown-panel-items {
286 .ng-optgroup {
287 user-select: none;
288 cursor: pointer;
289 line-height: 3em;
290 height: 3em;
291 padding: 0 16px;
292 color: $ng-select-secondary-text;
293 font-weight: 500;
294 &.ng-option-marked {
295 background: rgba(0, 0, 0, .04);
296 }
297 &.ng-option-disabled {
298 cursor: default;
299 }
300 &.ng-option-selected {
301 background: $ng-select-divider;
302 color: $ng-select-highlight;
303 }
304 }
305 .ng-option {
306 line-height: 3em;
307 min-height: 3em;
308 white-space: nowrap;
309 overflow: hidden;
310 text-overflow: ellipsis;
311 padding: 0 16px;
312 text-decoration: none;
313 position: relative;
314 color: $ng-select-primary-text;
315 text-align: left;
316 @include rtl {
317 text-align: right;
318 }
319 &.ng-option-marked {
320 background: rgba(0, 0, 0, .04);
321 color: $ng-select-primary-text;
322 }
323 &.ng-option-selected {
324 background: $ng-select-divider;
325 color: $ng-select-highlight;
326 }
327 &.ng-option-disabled {
328 color: $ng-select-disabled-text;
329 }
330 &.ng-option-child {
331 padding-left: 32px;
332 @include rtl {
333 padding-right: 32px;
334 padding-left: 0
335 }
336 }
337 .ng-tag-label {
338 padding-right: 5px;
339 @include rtl {
340 padding-left: 5px;
341 padding-right: 0;
342 }
343 font-size: 80%;
344 font-weight: 400;
345 color: $ng-select-disabled-text;
346 }
347 }
348 }
349}