UNPKG

48.4 kBSCSSView Raw
1//
2// Copyright 2020 Google Inc.
3//
4// Permission is hereby granted, free of charge, to any person obtaining a copy
5// of this software and associated documentation files (the "Software"), to deal
6// in the Software without restriction, including without limitation the rights
7// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8// copies of the Software, and to permit persons to whom the Software is
9// furnished to do so, subject to the following conditions:
10//
11// The above copyright notice and this permission notice shall be included in
12// all copies or substantial portions of the Software.
13//
14// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20// THE SOFTWARE.
21//
22
23// Selector '.mdc-*' should only be used in this project.
24// stylelint-disable selector-class-pattern --
25// Internal styling for Chip MDC component.
26
27@use 'sass:map';
28@use 'sass:math';
29@use 'sass:color';
30@use '@material/dom/dom';
31@use '@material/density/density';
32@use '@material/feature-targeting/feature-targeting';
33@use '@material/shape/shape';
34@use '@material/ripple/ripple-theme';
35@use '@material/rtl/rtl';
36@use '@material/theme/theme';
37@use '@material/theme/keys';
38@use '@material/elevation/elevation-theme';
39@use '@material/tokens/resolvers';
40@use '@material/theme/state';
41@use '@material/theme/theme-color';
42@use '@material/typography/typography';
43
44$height: 32px;
45$minimum-height: 24px;
46$maximum-height: $height;
47$density-scale: density.$default-scale;
48$density-config: (
49 height: (
50 default: $height,
51 maximum: $maximum-height,
52 minimum: $minimum-height,
53 ),
54);
55$radius: math.div($height, 2);
56$type-scale: body2;
57$container-color: color.mix(
58 theme-color.prop-value(on-surface),
59 theme-color.prop-value(surface),
60 12%
61);
62$text-label-color: rgba(theme-color.prop-value(on-surface), 0.87);
63$icon-color: rgba(theme-color.prop-value(on-surface), 0.87);
64$checkmark-color: rgba(theme-color.prop-value(on-surface), 0.87);
65$trailing-action-color: rgba(theme-color.prop-value(on-surface), 0.87);
66$ripple-color: on-surface;
67$checkmark-size: 20px;
68$leading-icon-size: 20px;
69$trailing-action-size: 18px;
70$leading-padding: 12px;
71$trailing-padding: 12px;
72$avatar-size: 24px;
73$avatar-leading-padding: 4px;
74$avatar-trailing-padding: 8px;
75$graphic-leading-padding: 6px;
76$graphic-trailing-padding: 6px;
77$trailing-action-leading-padding: 8px;
78$trailing-action-trailing-padding: 8px;
79$ripple-target: '.mdc-evolution-chip__ripple';
80$ripple-target-primary: '.mdc-evolution-chip__ripple--primary';
81$ripple-target-trailing: '.mdc-evolution-chip__ripple--trailing';
82
83// Filter chip colors
84$filter-selected-container-color: color.mix(
85 theme-color.prop-value(on-surface),
86 $container-color,
87 8%
88);
89
90$_light-theme: (
91 container-elevation: null,
92 container-height: null,
93 container-shadow-color: null,
94 container-shape: null,
95 disabled-label-text-color: null,
96 disabled-label-text-opacity: null,
97 disabled-outline-color: null,
98 disabled-outline-opacity: null,
99 elevated-container-color: null,
100 elevated-container-elevation: null,
101 elevated-container-shadow-color: null,
102 container-surface-tint-layer-color: null,
103 elevated-disabled-container-color: null,
104 elevated-disabled-container-elevation: null,
105 elevated-disabled-container-opacity: null,
106 elevated-focus-container-elevation: null,
107 elevated-hover-container-elevation: null,
108 elevated-pressed-container-elevation: null,
109 elevated-selected-container-color: null,
110 elevated-selected-container-elevation: null,
111 elevated-unselected-container-color: null,
112 flat-container-elevation: null,
113 flat-disabled-outline-color: null,
114 flat-disabled-outline-opacity: null,
115 flat-disabled-selected-outline-color: null,
116 flat-disabled-selected-outline-opacity: null,
117 flat-disabled-unselected-outline-color: null,
118 flat-disabled-unselected-outline-opacity: null,
119 flat-focus-outline-color: null,
120 flat-outline-color: null,
121 flat-outline-width: null,
122 flat-selected-container-color: null,
123 flat-selected-focus-container-elevation: null,
124 flat-selected-hover-container-elevation: null,
125 flat-selected-outline-color: null,
126 flat-selected-outline-width: null,
127 flat-selected-pressed-container-elevation: null,
128 flat-unselected-focus-container-elevation: null,
129 flat-unselected-focus-outline-color: null,
130 flat-unselected-hover-container-elevation: null,
131 flat-unselected-outline-color: null,
132 flat-unselected-outline-width: null,
133 flat-unselected-pressed-container-elevation: null,
134 focus-label-text-color: null,
135 focus-outline-color: null,
136 focus-state-layer-color: null,
137 focus-state-layer-opacity: null,
138 hover-label-text-color: null,
139 hover-state-layer-color: null,
140 hover-state-layer-opacity: null,
141 label-text-color: null,
142 label-text-font: null,
143 label-text-line-height: null,
144 label-text-size: null,
145 label-text-tracking: null,
146 label-text-weight: null,
147 outline-color: null,
148 outline-width: null,
149 pressed-label-text-color: null,
150 pressed-state-layer-color: null,
151 pressed-state-layer-opacity: null,
152 selected-focus-label-text-color: null,
153 selected-focus-state-layer-color: null,
154 selected-focus-state-layer-opacity: null,
155 selected-hover-label-text-color: null,
156 selected-hover-state-layer-color: null,
157 selected-hover-state-layer-opacity: null,
158 selected-label-text-color: null,
159 selected-pressed-label-text-color: null,
160 selected-pressed-state-layer-color: null,
161 selected-pressed-state-layer-opacity: null,
162 unselected-focus-label-text-color: null,
163 unselected-focus-state-layer-color: null,
164 unselected-focus-state-layer-opacity: null,
165 unselected-hover-label-text-color: null,
166 unselected-hover-state-layer-color: null,
167 unselected-hover-state-layer-opacity: null,
168 unselected-label-text-color: null,
169 unselected-pressed-label-text-color: null,
170 unselected-pressed-state-layer-color: null,
171 unselected-pressed-state-layer-opacity: null,
172 with-avatar-avatar-shape: null,
173 with-avatar-avatar-size: null,
174 with-avatar-disabled-avatar-opacity: null,
175 with-icon-disabled-icon-color: null,
176 with-icon-disabled-icon-opacity: null,
177 with-icon-focus-icon-color: null,
178 with-icon-hover-icon-color: null,
179 with-icon-icon-color: null,
180 with-icon-icon-size: null,
181 with-icon-pressed-icon-color: null,
182 with-icon-selected-focus-icon-color: null,
183 with-icon-selected-hover-icon-color: null,
184 with-icon-selected-icon-color: null,
185 with-icon-selected-pressed-icon-color: null,
186 with-icon-unselected-focus-icon-color: null,
187 with-icon-unselected-hover-icon-color: null,
188 with-icon-unselected-icon-color: null,
189 with-icon-unselected-pressed-icon-color: null,
190 with-leading-icon-disabled-leading-icon-color: null,
191 with-leading-icon-disabled-leading-icon-opacity: null,
192 with-leading-icon-focus-leading-icon-color: null,
193 with-leading-icon-hover-leading-icon-color: null,
194 with-leading-icon-leading-icon-color: null,
195 with-leading-icon-leading-icon-size: null,
196 with-leading-icon-pressed-leading-icon-color: null,
197 with-trailing-icon-disabled-trailing-icon-color: null,
198 with-trailing-icon-disabled-trailing-icon-opacity: null,
199 with-trailing-icon-focus-trailing-icon-color: null,
200 with-trailing-icon-hover-trailing-icon-color: null,
201 with-trailing-icon-pressed-trailing-icon-color: null,
202 with-trailing-icon-trailing-icon-color: null,
203 with-trailing-icon-trailing-icon-size: null,
204);
205
206@mixin theme-styles($theme, $resolvers: resolvers.$material) {
207 @include theme.validate-theme-keys($_light-theme, $theme);
208
209 @include _container-shape(map.get($theme, container-shape));
210 @include _avatar-shape(map.get($theme, with-avatar-avatar-shape));
211 @include graphic-size(map.get($theme, with-avatar-avatar-size));
212 @include height(map.get($theme, container-height));
213 @include elevation-theme.overlay-container-color(
214 map.get($theme, container-surface-tint-layer-color)
215 );
216 @include _container-elevation(
217 map.get($resolvers, elevation),
218 $shadow-color: map.get($theme, container-shadow-color),
219 $map: (default: map.get($theme, container-elevation))
220 );
221 @include _container-elevation(
222 map.get($resolvers, elevation),
223 $shadow-color: map.get($theme, flat-container-shadow-color),
224 $map: (enabled: map.get($theme, flat-container-elevation))
225 );
226 @include _container-elevation(
227 map.get($resolvers, elevation),
228 $shadow-color: map.get($theme, elevated-container-shadow-color),
229 $map: (
230 enabled: map.get($theme, elevated-container-elevation),
231 disabled: map.get($theme, elevated-disabled-container-elevation),
232 hover: map.get($theme, elevated-hover-container-elevation),
233 focus: map.get($theme, elevated-focus-container-elevation),
234 pressed: map.get($theme, elevated-pressed-container-elevation)
235 )
236 );
237 @include _selected-container-elevation(
238 map.get($resolvers, elevation),
239 $shadow-color: map.get($theme, elevated-container-shadow-color),
240 $map: (
241 enabled: map.get($theme, elevated-selected-container-elevation),
242 disabled: map.get($theme, elevated-selected-disabled-container-elevation),
243 hover: map.get($theme, elevated-selected-hover-container-elevation),
244 focus: map.get($theme, elevated-selected-focus-container-elevation),
245 pressed: map.get($theme, elevated-selected-pressed-container-elevation)
246 )
247 );
248 @include _selected-container-elevation(
249 map.get($resolvers, elevation),
250 $shadow-color: map.get($theme, elevated-container-shadow-color),
251 $map: (
252 enabled: map.get($theme, flat-selected-container-elevation),
253 disabled: map.get($theme, flat-selected-disabled-container-elevation),
254 hover: map.get($theme, flat-selected-hover-container-elevation),
255 focus: map.get($theme, flat-selected-focus-container-elevation),
256 pressed: map.get($theme, flat-selected-pressed-container-elevation)
257 )
258 );
259 @include _unselected-container-elevation(
260 map.get($resolvers, elevation),
261 $shadow-color: map.get($theme, elevated-container-shadow-color),
262 $map: (
263 enabled: map.get($theme, flat-unselected-container-elevation),
264 disabled: map.get($theme, flat-unselected-disabled-container-elevation),
265 hover: map.get($theme, flat-unselected-hover-container-elevation),
266 focus: map.get($theme, flat-unselected-focus-container-elevation),
267 pressed: map.get($theme, flat-unselected-pressed-container-elevation)
268 )
269 );
270 @include outline-color(
271 (
272 enabled: map.get($theme, flat-outline-color),
273 focus: map.get($theme, flat-focus-outline-color),
274 disabled: map.get($theme, flat-disabled-outline-color),
275 )
276 );
277 @include selected-outline-color(
278 (
279 enabled: map.get($theme, flat-selected-outline-color),
280 disabled: map.get($theme, flat-disabled-selected-outline-color),
281 )
282 );
283 @include _unselected-outline-color(
284 (
285 disabled: map.get($theme, flat-disabled-unselected-outline-color),
286 focus: map.get($theme, flat-unselected-focus-outline-color),
287 enabled: map.get($theme, flat-unselected-outline-color),
288 )
289 );
290 @include outline-width(map.get($theme, outline-width));
291 @include outline-width(map.get($theme, flat-outline-width));
292 @include _selected-outline-width(
293 map.get($theme, flat-selected-outline-width)
294 );
295 @include _unselected-outline-width(
296 map.get($theme, flat-unselected-outline-width)
297 );
298 @include container-color(
299 (
300 enabled: map.get($theme, elevated-container-color),
301 disabled: map.get($theme, elevated-disabled-container-color),
302 )
303 );
304 @include selected-container-color(
305 (
306 enabled: map.get($theme, elevated-selected-container-color),
307 )
308 );
309 @include selected-container-color(
310 (
311 enabled: map.get($theme, flat-selected-container-color),
312 )
313 );
314 @include _unselected-container-color(
315 (
316 enabled: map.get($theme, elevated-unselected-container-color),
317 )
318 );
319 @include _label-text-typography(
320 (
321 font: map.get($theme, label-text-font),
322 line-height: map.get($theme, label-text-line-height),
323 size: map.get($theme, label-text-size),
324 weight: map.get($theme, label-text-weight),
325 tracking: map.get($theme, label-text-tracking),
326 )
327 );
328 @include text-label-color(
329 (
330 enabled: map.get($theme, label-text-color),
331 hover: map.get($theme, hover-label-text-color),
332 focus: map.get($theme, focus-label-text-color),
333 pressed: map.get($theme, pressed-label-text-color),
334 disabled: map.get($theme, disabled-label-text-color),
335 )
336 );
337 @include selected-text-label-color(
338 (
339 enabled: map.get($theme, selected-label-text-color),
340 hover: map.get($theme, selected-hover-label-text-color),
341 focus: map.get($theme, selected-focus-label-text-color),
342 pressed: map.get($theme, selected-pressed-label-text-color),
343 disabled: map.get($theme, selected-disabled-label-text-color),
344 )
345 );
346 @include _unselected-text-label-color(
347 (
348 enabled: map.get($theme, unselected-label-text-color),
349 hover: map.get($theme, unselected-hover-label-text-color),
350 focus: map.get($theme, unselected-focus-label-text-color),
351 pressed: map.get($theme, unselected-pressed-label-text-color),
352 disabled: map.get($theme, unselected-disabled-label-text-color),
353 )
354 );
355
356 @include icon-size(map.get($theme, with-icon-icon-size));
357 @include icon-color(
358 (
359 enabled: map.get($theme, with-icon-icon-color),
360 disabled: map.get($theme, with-icon-disabled-icon-color),
361 hover: map.get($theme, with-icon-hover-icon-color),
362 focus: map.get($theme, with-icon-focus-icon-color),
363 pressed: map.get($theme, with-icon-pressed-icon-color),
364 )
365 );
366 @include _selected-icon-color(
367 (
368 enabled: map.get($theme, with-icon-selected-icon-color),
369 disabled: map.get($theme, with-icon-selected-disabled-icon-color),
370 hover: map.get($theme, with-icon-selected-hover-icon-color),
371 focus: map.get($theme, with-icon-selected-focus-icon-color),
372 pressed: map.get($theme, with-icon-selected-pressed-icon-color),
373 )
374 );
375 @include _unselected-icon-color(
376 (
377 enabled: map.get($theme, with-icon-unselected-icon-color),
378 disabled: map.get($theme, with-icon-unselected-disabled-icon-color),
379 hover: map.get($theme, with-icon-unselected-hover-icon-color),
380 focus: map.get($theme, with-icon-unselected-focus-icon-color),
381 pressed: map.get($theme, with-icon-unselected-pressed-icon-color),
382 )
383 );
384 @include icon-color(
385 (
386 disabled: map.get($theme, with-leading-icon-disabled-leading-icon-color),
387 focus: map.get($theme, with-leading-icon-focus-leading-icon-color),
388 hover: map.get($theme, with-leading-icon-hover-leading-icon-color),
389 enabled: map.get($theme, with-leading-icon-leading-icon-color),
390 pressed: map.get($theme, with-leading-icon-pressed-leading-icon-color),
391 )
392 );
393 @include trailing-action-color(
394 (
395 disabled: map.get($theme, with-trailing-icon-disabled-trailing-icon-color),
396 focus: map.get($theme, with-trailing-icon-focus-trailing-icon-color),
397 hover: map.get($theme, with-trailing-icon-hover-trailing-icon-color),
398 enabled: map.get($theme, with-trailing-icon-trailing-icon-color),
399 pressed: map.get($theme, with-trailing-icon-pressed-trailing-icon-color),
400 )
401 );
402 @include _ripple-theme(
403 (
404 focus-state-layer-color: map.get($theme, focus-state-layer-color),
405 focus-state-layer-opacity: map.get($theme, focus-state-layer-opacity),
406 hover-state-layer-color: map.get($theme, hover-state-layer-color),
407 hover-state-layer-opacity: map.get($theme, hover-state-layer-opacity),
408 pressed-state-layer-color: map.get($theme, pressed-state-layer-color),
409 pressed-state-layer-opacity: map.get($theme, pressed-state-layer-opacity),
410 )
411 );
412 @include _selected-ripple-theme(
413 (
414 focus-state-layer-color: map.get($theme, selected-focus-state-layer-color),
415 focus-state-layer-opacity:
416 map.get($theme, selected-focus-state-layer-opacity),
417 hover-state-layer-color: map.get($theme, selected-hover-state-layer-color),
418 hover-state-layer-opacity:
419 map.get($theme, selected-hover-state-layer-opacity),
420 pressed-state-layer-color:
421 map.get($theme, selected-pressed-state-layer-color),
422 pressed-state-layer-opacity:
423 map.get($theme, selected-pressed-state-layer-opacity),
424 )
425 );
426 @include _unselected-ripple-theme(
427 (
428 focus-state-layer-color:
429 map.get($theme, unselected-focus-state-layer-color),
430 focus-state-layer-opacity:
431 map.get($theme, unselected-focus-state-layer-opacity),
432 hover-state-layer-color:
433 map.get($theme, unselected-hover-state-layer-color),
434 hover-state-layer-opacity:
435 map.get($theme, unselected-hover-state-layer-opacity),
436 pressed-state-layer-color:
437 map.get($theme, unselected-pressed-state-layer-color),
438 pressed-state-layer-opacity:
439 map.get($theme, unselected-pressed-state-layer-opacity),
440 )
441 );
442}
443
444@mixin _ripple-theme($ripple-theme) {
445 .mdc-evolution-chip__action--primary {
446 @include ripple-theme.internal-theme-styles(
447 (
448 focus-state-layer-color: map.get($ripple-theme, focus-state-layer-color),
449 focus-state-layer-opacity:
450 map.get($ripple-theme, focus-state-layer-opacity),
451 hover-state-layer-color: map.get($ripple-theme, hover-state-layer-color),
452 hover-state-layer-opacity:
453 map.get($ripple-theme, hover-state-layer-opacity),
454 pressed-state-layer-color:
455 map.get($ripple-theme, pressed-state-layer-color),
456 pressed-state-layer-opacity:
457 map.get($ripple-theme, pressed-state-layer-opacity),
458 ),
459 $ripple-target: $ripple-target
460 );
461 }
462}
463
464@mixin _selected-ripple-theme($ripple-theme) {
465 @include _is-selected() {
466 @include _ripple-theme($ripple-theme);
467 }
468}
469
470@mixin _unselected-ripple-theme($ripple-theme) {
471 @include _is-unselected() {
472 @include _ripple-theme($ripple-theme);
473 }
474}
475
476///
477/// Sets the ripple color of the chip.
478/// @param {Color} $color - The color of the ripple.
479/// @param {Map} $opacity-map [null] - The optional opacity map for the states.
480///
481@mixin ripple-color(
482 $color,
483 $opacity-map: null,
484 $query: feature-targeting.all()
485) {
486 @include _ripple-color($color, $opacity-map, $query);
487}
488
489///
490/// Sets the selected ripple color of the chip.
491/// @param {Color} $color - The color of the ripple.
492/// @param {Map} $opacity-map [null] - The optional opacity map for the states.
493///
494@mixin selected-ripple-color(
495 $color,
496 $opacity-map: null,
497 $query: feature-targeting.all()
498) {
499 &.mdc-evolution-chip--selected {
500 @include ripple-color($color, $opacity-map, $query: $query);
501 }
502}
503
504@mixin _ripple-color($color, $opacity-map, $query) {
505 .mdc-evolution-chip__action--primary {
506 @include ripple-theme.states(
507 $color: $color,
508 $opacity-map: $opacity-map,
509 $query: $query,
510 $ripple-target: $ripple-target
511 );
512 }
513}
514
515///
516/// Sets the ripple color of the chip's trailing action.
517/// @param {Color} $color - The color of the ripple.
518/// @param {Map} $opacity-map [null] - The optional opacity map for the states.
519///
520@mixin trailing-action-ripple-color(
521 $color,
522 $opacity-map: null,
523 $query: feature-targeting.all()
524) {
525 .mdc-evolution-chip__action--trailing {
526 @include ripple-theme.states(
527 $color: $color,
528 $opacity-map: $opacity-map,
529 $query: $query,
530 $ripple-target: $ripple-target
531 );
532 }
533}
534
535///
536/// Sets the size of the trailing action's ripple.
537/// @param {Number} $size - The size of the ripple.
538///
539@mixin trailing-action-ripple-size($size, $query: feature-targeting.all()) {
540 $feat-structure: feature-targeting.create-target($query, structure);
541 .mdc-evolution-chip__ripple--trailing {
542 @include feature-targeting.targets($feat-structure) {
543 @include theme.property(height, $size);
544 @include theme.property(width, $size);
545 }
546 }
547}
548
549///
550/// Sets the density scale for the chip.
551/// @param {Number | String} $density-scale - Density scale value for component.
552/// Supported density scale values are `-2`, `-1`, `0`.
553///
554@mixin density($density-scale, $query: feature-targeting.all()) {
555 $height: density.prop-value(
556 $density-config: $density-config,
557 $density-scale: $density-scale,
558 $property-name: height,
559 );
560
561 @include height($height, $query: $query);
562
563 @if $density-scale != 0 {
564 @include _reset-touch-target($query: $query);
565 }
566}
567
568///
569/// Resets touch target-related styles. This is called from the density mixin to
570/// automatically remove the increased touch target, since dense components
571/// don't have the same default a11y requirements.
572/// @access private
573///
574@mixin _reset-touch-target($query: feature-targeting.all()) {
575 $feat-structure: feature-targeting.create-target($query, structure);
576
577 .mdc-evolution-chip__action-touch {
578 @include feature-targeting.targets($feat-structure) {
579 display: none;
580 }
581 }
582}
583
584///
585/// Sets custom height for the chip.
586/// @param {Number} $height - The height of the chip.
587///
588@mixin height($height, $query: feature-targeting.all()) {
589 $feat-structure: feature-targeting.create-target($query, structure);
590
591 @include feature-targeting.targets($feat-structure) {
592 @include theme.property(height, $height);
593 }
594}
595
596@mixin _container-shape($radius) {
597 @include shape.radius($radius);
598
599 #{$ripple-target} {
600 @include shape.radius($radius);
601 }
602
603 .mdc-evolution-chip__action--primary:before {
604 @include shape.radius($radius);
605 }
606}
607
608@mixin _avatar-shape($radius) {
609 .mdc-evolution-chip__icon--primary {
610 @include shape.radius($radius);
611 }
612}
613
614///
615/// Sets the shape radius of the chip.
616/// @param {Number|List} $radius - Shape radius in `border-radius` CSS format.
617/// @param {Boolean} $rtl-reflexive - True flips radius corners in RTL.
618///
619@mixin shape-radius(
620 $radius,
621 $rtl-reflexive: false,
622 $density-scale: $density-scale,
623 $query: feature-targeting.all()
624) {
625 $height: density.prop-value(
626 $density-config: $density-config,
627 $density-scale: $density-scale,
628 $property-name: height,
629 );
630
631 @include shape.radius(
632 $radius,
633 $rtl-reflexive,
634 $component-height: $height,
635 $query: $query
636 );
637
638 #{$ripple-target} {
639 @include shape.radius(
640 $radius,
641 $rtl-reflexive,
642 $component-height: $height,
643 $query: $query
644 );
645 }
646
647 .mdc-evolution-chip__action--primary:before {
648 @include shape.radius(
649 $radius,
650 $rtl-reflexive,
651 $component-height: $height,
652 $query: $query
653 );
654 }
655
656 .mdc-evolution-chip__icon--primary {
657 @include shape.radius(
658 $radius,
659 $rtl-reflexive,
660 $component-height: $height,
661 $query: $query
662 );
663 }
664}
665
666///
667/// Sets the width of the chip outline.
668/// @param {Number} $width - The width of the chip outline.
669///
670@mixin outline-width($width, $query: feature-targeting.all()) {
671 $feat-structure: feature-targeting.create-target($query, structure);
672
673 .mdc-evolution-chip__action--primary:before {
674 @include feature-targeting.targets($feat-structure) {
675 @include theme.property(border-width, $width);
676 }
677 }
678}
679
680@mixin _selected-outline-width($width) {
681 @include _is-selected() {
682 @include outline-width($width);
683 }
684}
685
686@mixin _unselected-outline-width($width) {
687 @include _is-unselected() {
688 @include outline-width($width);
689 }
690}
691
692///
693/// Customizes the outline color, using a Color or state Map.
694/// - To set only the default color, provide a single Color.
695/// - To set one or more state colors, provide a state Map with optional keys.
696/// - Supported state Map keys: `default`, `enabled`, `focus`, `disabled`.
697///
698/// @example
699/// @include outline-color(blue);
700/// @include outline-color((disabled: gray));
701///
702/// @param {Color | Map} $color-or-map - The outline's color or a state Map
703///
704@mixin outline-color($color-or-map, $query: feature-targeting.all()) {
705 @include _outline-color(state.get-default-state($color-or-map), $query);
706 @include _is-enabled() {
707 @include _outline-color(state.get-enabled-state($color-or-map), $query);
708 }
709 @include _focus-outline-color(state.get-focus-state($color-or-map), $query);
710 @include _is-disabled() {
711 @include _outline-color(state.get-disabled-state($color-or-map), $query);
712 }
713}
714
715@mixin _selected-outline-color($color-or-map) {
716 @include _is-selected() {
717 @include _outline-color($color-or-map);
718 }
719}
720
721///
722/// Customizes the selected outline color, using a Color or state Map.
723/// - To set only the default color, provide a single Color.
724/// - To set one or more state colors, provide a state Map with optional keys.
725/// - Supported state Map keys: `default`, `enabled`, `focus`, `disabled`.
726///
727/// @example
728/// @include selected-outline-color(blue);
729/// @include selected-outline-color((disabled: gray));
730///
731/// @param {Color | Map} $color-or-map - The outline's color or a state Map
732///
733@mixin selected-outline-color($color-or-map, $query: feature-targeting.all()) {
734 @include _is-selected() {
735 @include outline-color($color-or-map, $query: $query);
736 }
737}
738
739@mixin _unselected-outline-color($color-or-map) {
740 @include _is-unselected() {
741 @include outline-color($color-or-map);
742 }
743}
744
745@mixin _outline-color($color, $query: feature-targeting.all()) {
746 $feat-color: feature-targeting.create-target($query, color);
747
748 .mdc-evolution-chip__action--primary:before {
749 @include feature-targeting.targets($feat-color) {
750 @if $color {
751 @include theme.property(border-color, $color);
752 }
753
754 // TODO(b/206694742): Find a better solution.
755 @if $color == transparent {
756 @include dom.forced-colors-mode($exclude-ie11: true) {
757 @include theme.property(border-color, CanvasText);
758 }
759 }
760 }
761 }
762}
763
764@mixin _focus-outline-color($color, $query: feature-targeting.all()) {
765 $feat-color: feature-targeting.create-target($query, color);
766
767 .mdc-evolution-chip__action--primary:not(.mdc-evolution-chip__action--presentational) {
768 @include ripple-theme.focus() {
769 &:before {
770 @include feature-targeting.targets($feat-color) {
771 @if $color {
772 @include theme.property(border-color, $color);
773 }
774 }
775 }
776 }
777 }
778}
779
780///
781/// Sets the style of the chip outline.
782/// @param {String} $style - The style of the chip outline.
783///
784@mixin outline-style($style, $query: feature-targeting.all()) {
785 $feat-structure: feature-targeting.create-target($query, structure);
786
787 .mdc-evolution-chip__action--primary:before {
788 @include feature-targeting.targets($feat-structure) {
789 @include theme.property(border-style, $style);
790 }
791 }
792}
793
794///
795/// Customizes the container color, using a Color or state Map.
796/// - To set only the default color, provide a single Color.
797/// - To set one or more state colors, provide a state Map with optional keys.
798/// - Supported state Map keys: `default`, `enabled`, `disabled`.
799///
800/// @example
801/// @include container-color(blue);
802/// @include container-color((disabled: gray));
803///
804/// @param {Color | Map} $color-or-map - The container's color or a state Map
805///
806@mixin container-color($color-or-map, $query: feature-targeting.all()) {
807 @include _container-color(state.get-default-state($color-or-map), $query);
808 @include _is-enabled() {
809 @include _container-color(state.get-enabled-state($color-or-map), $query);
810 }
811 @include _is-disabled() {
812 @include _container-color(state.get-disabled-state($color-or-map), $query);
813 }
814}
815
816///
817/// Customizes the selected container color, using a Color or state Map.
818/// - To set only the default color, provide a single Color.
819/// - To set one or more state colors, provide a state Map with optional keys.
820/// - Supported state Map keys: `default`, `enabled`, `disabled`.
821///
822/// @example
823/// @include selected-container-color(blue);
824/// @include selected-container-color((disabled: gray));
825///
826/// @param {Color | Map} $color-or-map - The container's color or a state Map
827///
828@mixin selected-container-color(
829 $color-or-map,
830 $query: feature-targeting.all()
831) {
832 @include _is-selected() {
833 @include container-color($color-or-map, $query: $query);
834 }
835}
836
837@mixin _unselected-container-color($color-or-map) {
838 @include _is-unselected() {
839 @include container-color($color-or-map);
840 }
841}
842
843@mixin _container-color($color, $query: feature-targeting.all()) {
844 $feat-color: feature-targeting.create-target($query, color);
845
846 @include feature-targeting.targets($feat-color) {
847 @if $color {
848 @include theme.property(background-color, $color);
849 }
850 }
851}
852
853///
854/// Customizes the text label color, using a Color or state Map.
855/// - To set only the default color, provide a single Color.
856/// - To set one or more state colors, provide a state Map with optional keys.
857/// - Supported state Map keys: `default`, `enabled`, `hover`, `focus`, `disabled`.
858///
859/// @example
860/// @include text-label-color(blue);
861/// @include text-label-color((disabled: gray));
862///
863/// @param {Color | Map} $color-or-map - The label's color or a state Map
864///
865@mixin text-label-color($color-or-map, $query: feature-targeting.all()) {
866 @include _text-label-color(state.get-default-state($color-or-map), $query);
867 @include _is-enabled() {
868 @include _text-label-color(state.get-enabled-state($color-or-map), $query);
869 }
870 .mdc-evolution-chip__action--primary:not(.mdc-evolution-chip__action--presentational):hover {
871 @include _text-label-color(state.get-hover-state($color-or-map), $query);
872 }
873
874 .mdc-evolution-chip__action--primary:not(.mdc-evolution-chip__action--presentational) {
875 @include ripple-theme.focus() {
876 @include _text-label-color(state.get-focus-state($color-or-map), $query);
877 }
878 }
879
880 @include _is-disabled() {
881 @include _text-label-color(state.get-disabled-state($color-or-map), $query);
882 }
883}
884
885@mixin _label-text-typography($typography-theme) {
886 .mdc-evolution-chip__text-label {
887 @include typography.theme-styles($typography-theme);
888 }
889}
890
891///
892/// Customizes the selected text label color, using a Color or state Map.
893/// - To set only the default color, provide a single Color.
894/// - To set one or more state colors, provide a state Map with optional keys.
895/// - Supported state Map keys: `default`, `hover`, `focus`, `disabled`.
896///
897/// @example
898/// @include selected-text-label-color(blue);
899/// @include selected-text-label-color((disabled: gray));
900///
901/// @param {Color | Map} $color-or-map - The label's color or a state Map
902///
903@mixin selected-text-label-color(
904 $color-or-map,
905 $query: feature-targeting.all()
906) {
907 @include _is-selected() {
908 @include text-label-color($color-or-map, $query: $query);
909 }
910}
911
912@mixin _unselected-text-label-color($color-or-map) {
913 @include _is-unselected() {
914 @include text-label-color($color-or-map);
915 }
916}
917
918@mixin _text-label-color($color, $query: feature-targeting.all()) {
919 $feat-color: feature-targeting.create-target($query, color);
920
921 .mdc-evolution-chip__text-label {
922 @include feature-targeting.targets($feat-color) {
923 @if $color {
924 @include theme.property(color, $color);
925 }
926 }
927 }
928}
929
930///
931/// Sets the type scale of the text label.
932/// @param {String} $type-scale - The type scale of the text label.
933///
934@mixin text-label-type-scale($type-scale, $query: feature-targeting.all()) {
935 .mdc-evolution-chip__text-label {
936 @include typography.typography($type-scale, $query: $query);
937 }
938}
939
940///
941/// Sets the size of the graphic.
942/// @param {Number} $size - The size of the graphic.
943///
944@mixin graphic-size($size, $query: feature-targeting.all()) {
945 $feat-structure: feature-targeting.create-target($query, structure);
946
947 // Expose the width as a readable custom property that can be used when
948 // computing the chip bounding client rect as an additive value for the chip
949 // width. This solves for selectable chips without icons growing/shrinking as
950 // they toggle their selected state. The ripple dimensions will have been
951 // computed based on the unselected bounding client react which will not have
952 // enough horizontal space to account for the growth in width.
953 &.mdc-evolution-chip--selectable:not(.mdc-evolution-chip--with-primary-icon) {
954 @if $size {
955 @include theme.property(--mdc-chip-graphic-selected-width, $size);
956 }
957 }
958
959 .mdc-evolution-chip__graphic {
960 @include feature-targeting.targets($feat-structure) {
961 @include theme.property(height, $size);
962 @include theme.property(width, $size);
963 @include theme.property(font-size, $size);
964 }
965 }
966}
967
968///
969/// Customizes the icon color, using a Color or state Map.
970/// - To set only the default color, provide a single Color.
971/// - To set one or more state colors, provide a state Map with optional keys.
972/// - Supported state Map keys: `default`, `enabled`, `focus`, `disabled`.
973///
974/// @example
975/// @include icon-color(blue);
976/// @include icon-color((disabled: gray));
977///
978/// @param {Color | Map} $color-or-map - The icon's color or a state Map
979///
980@mixin icon-color($color-or-map, $query: feature-targeting.all()) {
981 @include _icon-color(state.get-default-state($color-or-map), $query);
982
983 @include _is-enabled() {
984 @include _icon-color(state.get-enabled-state($color-or-map), $query);
985 }
986
987 .mdc-evolution-chip__action--primary:not(.mdc-evolution-chip__action--presentational):hover {
988 @include _icon-color(state.get-hover-state($color-or-map), $query);
989 }
990
991 .mdc-evolution-chip__action--primary:not(.mdc-evolution-chip__action--presentational) {
992 @include ripple-theme.focus() {
993 @include _icon-color(state.get-focus-state($color-or-map), $query);
994 }
995 }
996
997 @include _is-disabled() {
998 @include _icon-color(state.get-disabled-state($color-or-map), $query);
999 }
1000}
1001
1002@mixin _selected-icon-color($color-or-map) {
1003 @include checkmark-color($color-or-map);
1004}
1005
1006@mixin _unselected-icon-color($color-or-map) {
1007 @include _is-unselected() {
1008 @include icon-color($color-or-map);
1009 }
1010}
1011
1012@mixin _icon-color($color, $query: feature-targeting.all()) {
1013 $feat-color: feature-targeting.create-target($query, color);
1014
1015 .mdc-evolution-chip__icon--primary {
1016 @include feature-targeting.targets($feat-color) {
1017 @if $color {
1018 @include theme.property(color, $color);
1019 }
1020 }
1021 }
1022}
1023
1024///
1025/// Customizes the icon container color, using a Color or state Map.
1026/// - To set only the default color, provide a single Color.
1027/// - To set one or more state colors, provide a state Map with optional keys.
1028/// - Supported state Map keys: `default`, `hover`, `focus`, `disabled`.
1029///
1030/// @example
1031/// @include icon-container-color(blue);
1032/// @include icon-container-color((disabled: gray));
1033///
1034/// @param {Color | Map} $color-or-map - The icon's container color or a state Map
1035///
1036@mixin icon-container-color($color-or-map, $query: feature-targeting.all()) {
1037 @include _icon-container-color(
1038 state.get-default-state($color-or-map),
1039 $query
1040 );
1041
1042 .mdc-evolution-chip__action--primary:not(.mdc-evolution-chip__action--presentational):hover {
1043 @include _icon-container-color(
1044 state.get-hover-state($color-or-map),
1045 $query
1046 );
1047 }
1048
1049 .mdc-evolution-chip__action--primary:not(.mdc-evolution-chip__action--presentational) {
1050 @include ripple-theme.focus() {
1051 @include _icon-container-color(
1052 state.get-focus-state($color-or-map),
1053 $query
1054 );
1055 }
1056 }
1057
1058 &.mdc-evolution-chip--disabled {
1059 @include _icon-container-color(
1060 state.get-disabled-state($color-or-map),
1061 $query
1062 );
1063 }
1064}
1065
1066@mixin _icon-container-color($color, $query: feature-targeting.all()) {
1067 $feat-color: feature-targeting.create-target($query, color);
1068
1069 .mdc-evolution-chip__icon--primary {
1070 @include feature-targeting.targets($feat-color) {
1071 @if $color {
1072 @include theme.property(background-color, $color);
1073 }
1074 }
1075 }
1076}
1077
1078///
1079/// Sets the size of the icon.
1080/// @param {Number} $size - The size of the icon.
1081///
1082@mixin icon-size($size, $query: feature-targeting.all()) {
1083 $feat-structure: feature-targeting.create-target($query, structure);
1084
1085 .mdc-evolution-chip__icon--primary {
1086 @include feature-targeting.targets($feat-structure) {
1087 @include theme.property(height, $size);
1088 @include theme.property(width, $size);
1089 @include theme.property(font-size, $size);
1090 }
1091 }
1092}
1093
1094///
1095/// Sets the size of the trailing action.
1096/// @param {Number} $size - The size of the trailing action.
1097///
1098@mixin trailing-action-size($size, $query: feature-targeting.all()) {
1099 $feat-structure: feature-targeting.create-target($query, structure);
1100
1101 .mdc-evolution-chip__icon--trailing {
1102 @include feature-targeting.targets($feat-structure) {
1103 @include theme.property(height, $size);
1104 @include theme.property(width, $size);
1105 @include theme.property(font-size, $size);
1106 }
1107 }
1108}
1109
1110///
1111/// Customizes the trailing action color, using a Color or state Map.
1112/// - To set only the default color, provide a single Color.
1113/// - To set one or more state colors, provide a state Map with optional keys.
1114/// - Supported state Map keys: `default`, `hover`, `focus`, `disabled`.
1115///
1116/// @example
1117/// @include trailing-action-color(blue);
1118/// @include trailing-action-color((disabled: gray));
1119///
1120/// @param {Color | Map} $color-or-map - The trailing action's color or a state Map
1121///
1122@mixin trailing-action-color($color-or-map, $query: feature-targeting.all()) {
1123 @include _trailing-action-color(
1124 state.get-default-state($color-or-map),
1125 $query
1126 );
1127
1128 @include _is-enabled() {
1129 @include _trailing-action-color(
1130 state.get-enabled-state($color-or-map),
1131 $query
1132 );
1133 }
1134
1135 .mdc-evolution-chip__action--trailing:hover {
1136 @include _trailing-action-color(
1137 state.get-hover-state($color-or-map),
1138 $query
1139 );
1140 }
1141
1142 .mdc-evolution-chip__action--trailing {
1143 @include ripple-theme.focus() {
1144 @include _trailing-action-color(
1145 state.get-focus-state($color-or-map),
1146 $query
1147 );
1148 }
1149 }
1150
1151 @include _is-disabled() {
1152 @include _trailing-action-color(
1153 state.get-disabled-state($color-or-map),
1154 $query
1155 );
1156 }
1157}
1158
1159@mixin _trailing-action-color($color, $query: feature-targeting.all()) {
1160 $feat-color: feature-targeting.create-target($query, color);
1161
1162 .mdc-evolution-chip__icon--trailing {
1163 @include feature-targeting.targets($feat-color) {
1164 @if $color {
1165 @include theme.property(color, $color);
1166 }
1167 }
1168 }
1169}
1170
1171///
1172/// Sets the size of the checkmark.
1173/// @param {Number} $size - The size of the checkmark.
1174///
1175@mixin checkmark-size($size, $query: feature-targeting.all()) {
1176 $feat-structure: feature-targeting.create-target($query, structure);
1177
1178 .mdc-evolution-chip__checkmark {
1179 @include feature-targeting.targets($feat-structure) {
1180 @include theme.property(height, $size);
1181 @include theme.property(width, $size);
1182 }
1183 }
1184}
1185
1186///
1187/// Customizes the checkmark color, using a Color or state Map.
1188/// - To set only the default color, provide a single Color.
1189/// - To set one or more state colors, provide a state Map with optional keys.
1190/// - Supported state Map keys: `default`, `enabled`, `hover`, `focus`, `disabled`.
1191///
1192/// @example
1193/// @include checkmark-color(blue);
1194/// @include checkmark-color((disabled: gray));
1195///
1196/// @param {Color | Map} $color-or-map - The checkmark's color or a state Map
1197///
1198@mixin checkmark-color($color-or-map, $query: feature-targeting.all()) {
1199 @include _checkmark-color(state.get-default-state($color-or-map), $query);
1200
1201 @include _is-enabled() {
1202 @include _checkmark-color(state.get-enabled-state($color-or-map), $query);
1203 }
1204
1205 .mdc-evolution-chip__action--primary:not(.mdc-evolution-chip__action--presentational):hover {
1206 @include _checkmark-color(state.get-hover-state($color-or-map), $query);
1207 }
1208
1209 .mdc-evolution-chip__action--primary {
1210 @include ripple-theme.focus() {
1211 @include _checkmark-color(state.get-focus-state($color-or-map), $query);
1212 }
1213 }
1214
1215 @include _is-disabled() {
1216 @include _checkmark-color(state.get-disabled-state($color-or-map), $query);
1217 }
1218}
1219
1220@mixin _checkmark-color($color, $query: feature-targeting.all()) {
1221 $feat-color: feature-targeting.create-target($query, color);
1222
1223 .mdc-evolution-chip__checkmark {
1224 @include feature-targeting.targets($feat-color) {
1225 @if $color {
1226 @include theme.property(color, $color);
1227 }
1228 }
1229 }
1230}
1231
1232///
1233/// Customizes the checkmark container color, using a Color or state Map.
1234/// - To set only the default color, provide a single Color.
1235/// - To set one or more state colors, provide a state Map with optional keys.
1236/// - Supported state Map keys: `default`, `hover`, `focus`, `disabled`.
1237///
1238/// @example
1239/// @include checkmark-container-color(blue);
1240/// @include checkmark-container-color((disabled: gray));
1241///
1242/// @param {Color | Map} $color-or-map - The checkmark container's color or a state Map
1243///
1244@mixin checkmark-container-color(
1245 $color-or-map,
1246 $query: feature-targeting.all()
1247) {
1248 @include _checkmark-container-color(
1249 state.get-default-state($color-or-map),
1250 $query
1251 );
1252
1253 &.mdc-evolution-chip--disabled {
1254 @include _checkmark-container-color(
1255 state.get-disabled-state($color-or-map),
1256 $query
1257 );
1258 }
1259}
1260
1261@mixin _checkmark-container-color($color, $query: feature-targeting.all()) {
1262 $feat-color: feature-targeting.create-target($query, color);
1263
1264 .mdc-evolution-chip__checkmark-background {
1265 @include feature-targeting.targets($feat-color) {
1266 @if $color {
1267 @include theme.property(background-color, $color);
1268 }
1269 }
1270 }
1271}
1272
1273///
1274/// Sets the horizontal padding for the chip.
1275/// @param {Number} $leading - The leading padding for the chip.
1276/// @param {Number} $trailing [$leading] - The trailing padding for the chip.
1277///
1278@mixin horizontal-padding(
1279 $leading,
1280 $trailing: $leading,
1281 $query: feature-targeting.all()
1282) {
1283 $feat-structure: feature-targeting.create-target($query, structure);
1284
1285 .mdc-evolution-chip__action--primary {
1286 @include feature-targeting.targets($feat-structure) {
1287 @include rtl.reflexive-property(padding, $leading, $trailing);
1288 }
1289 }
1290}
1291
1292///
1293/// Sets the horizontal padding for chips with a graphic.
1294/// @param {Number} $graphic-leading - The leading padding for the graphic.
1295/// @param {Number} $graphic-trailing - The trailing padding for the graphic.
1296/// @param {Number} $primary-trailing - The trailing padding for the primary action.
1297///
1298@mixin with-graphic-horizontal-padding(
1299 $graphic-leading,
1300 $graphic-trailing,
1301 $primary-trailing,
1302 $query: feature-targeting.all()
1303) {
1304 $feat-structure: feature-targeting.create-target($query, structure);
1305
1306 &.mdc-evolution-chip--with-primary-graphic {
1307 .mdc-evolution-chip__graphic {
1308 @include feature-targeting.targets($feat-structure) {
1309 @include rtl.reflexive-property(
1310 padding,
1311 $graphic-leading,
1312 $graphic-trailing
1313 );
1314 }
1315 }
1316
1317 .mdc-evolution-chip__action--primary {
1318 @include feature-targeting.targets($feat-structure) {
1319 @include rtl.reflexive-property(padding, 0, $primary-trailing);
1320 }
1321 }
1322 }
1323}
1324
1325///
1326/// Sets the horizontal padding for chips with a trailing action.
1327/// @param {Number} $primary-leading - The leading padding for the primary action.
1328/// @param {Number} $trailing-action-leading - The leading padding for the trailing action.
1329/// @param {Number} $trailing-action-trailing - The trailing padding for the trailing action.
1330///
1331@mixin with-trailing-action-horizontal-padding(
1332 $primary-leading,
1333 $trailing-action-leading,
1334 $trailing-action-trailing,
1335 $query: feature-targeting.all()
1336) {
1337 $feat-structure: feature-targeting.create-target($query, structure);
1338
1339 &.mdc-evolution-chip--with-trailing-action {
1340 .mdc-evolution-chip__action--trailing {
1341 @include feature-targeting.targets($feat-structure) {
1342 @include rtl.reflexive-property(
1343 padding,
1344 $trailing-action-leading,
1345 $trailing-action-trailing
1346 );
1347 }
1348 }
1349
1350 #{$ripple-target-trailing} {
1351 @include feature-targeting.targets($feat-structure) {
1352 @include rtl.reflexive-position(left, $trailing-action-leading);
1353 }
1354 }
1355
1356 .mdc-evolution-chip__action--primary {
1357 @include feature-targeting.targets($feat-structure) {
1358 @include rtl.reflexive-property(padding, $primary-leading, 0);
1359 }
1360 }
1361 }
1362}
1363
1364///
1365/// Sets the horizontal padding for chips with a graphic and trailing action.
1366/// @param {Number} $graphic-leading - The leading padding for the graphic.
1367/// @param {Number} $graphic-trailing - The trailing padding for the graphic.
1368/// @param {Number} $trailing-action-leading - The leading padding for the trailing action.
1369/// @param {Number} $trailing-action-trailing - The trailing padding for the trailing action.
1370///
1371@mixin with-graphic-and-trailing-action-horizontal-padding(
1372 $graphic-leading,
1373 $graphic-trailing,
1374 $trailing-action-leading,
1375 $trailing-action-trailing,
1376 $query: feature-targeting.all()
1377) {
1378 $feat-structure: feature-targeting.create-target($query, structure);
1379 &.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action {
1380 .mdc-evolution-chip__graphic {
1381 @include feature-targeting.targets($feat-structure) {
1382 @include rtl.reflexive-property(
1383 padding,
1384 $graphic-leading,
1385 $graphic-trailing
1386 );
1387 }
1388 }
1389
1390 .mdc-evolution-chip__action--trailing {
1391 @include feature-targeting.targets($feat-structure) {
1392 @include rtl.reflexive-property(
1393 padding,
1394 $trailing-action-leading,
1395 $trailing-action-trailing
1396 );
1397 }
1398 }
1399
1400 #{$ripple-target-trailing} {
1401 @include feature-targeting.targets($feat-structure) {
1402 @include rtl.reflexive-position(left, $trailing-action-leading);
1403 }
1404 }
1405
1406 .mdc-evolution-chip__action--primary {
1407 @include feature-targeting.targets($feat-structure) {
1408 @include rtl.reflexive-property(padding, 0, 0);
1409 }
1410 }
1411 }
1412}
1413
1414@mixin _container-elevation($resolver, $shadow-color, $map) {
1415 @include _is-enabled() {
1416 @if (state.get-enabled-state($map)) {
1417 @include elevation-theme.with-resolver(
1418 $resolver,
1419 $elevation: state.get-enabled-state($map),
1420 $shadow-color: $shadow-color
1421 );
1422 }
1423 }
1424
1425 @include ripple-theme.hover() {
1426 @if state.get-hover-state($map) {
1427 @include elevation-theme.with-resolver(
1428 $resolver,
1429 $elevation: state.get-hover-state($map),
1430 $shadow-color: $shadow-color
1431 );
1432 }
1433 }
1434
1435 @include ripple-theme.focus() {
1436 @if (state.get-focus-state($map)) {
1437 @include elevation-theme.with-resolver(
1438 $resolver,
1439 $elevation: state.get-focus-state($map),
1440 $shadow-color: $shadow-color
1441 );
1442 }
1443 }
1444
1445 @include ripple-theme.pressed() {
1446 @if (state.get-pressed-state($map)) {
1447 @include elevation-theme.with-resolver(
1448 $resolver,
1449 $elevation: state.get-pressed-state($map),
1450 $shadow-color: $shadow-color
1451 );
1452 }
1453 }
1454
1455 @include _is-disabled() {
1456 @if (state.get-disabled-state($map)) {
1457 @include elevation-theme.with-resolver(
1458 $resolver,
1459 $elevation: state.get-disabled-state($map),
1460 $shadow-color: $shadow-color
1461 );
1462 }
1463 }
1464}
1465
1466@mixin _selected-container-elevation($resolver, $shadow-color, $map) {
1467 @include _is-selected() {
1468 @include _container-elevation($resolver, $shadow-color, $map);
1469 }
1470}
1471
1472@mixin _unselected-container-elevation($resolver, $shadow-color, $map) {
1473 @include _is-unselected() {
1474 @include _container-elevation($resolver, $shadow-color, $map);
1475 }
1476}
1477
1478@mixin _is-enabled() {
1479 &:not(.mdc-evolution-chip--disabled) {
1480 @content;
1481 }
1482}
1483
1484@mixin _is-disabled() {
1485 &.mdc-evolution-chip--disabled {
1486 @content;
1487 }
1488}
1489
1490@mixin _is-selected() {
1491 &.mdc-evolution-chip--selected {
1492 @content;
1493 }
1494}
1495
1496@mixin _is-unselected() {
1497 &:not(.mdc-evolution-chip--selected) {
1498 @content;
1499 }
1500}