|
23 | 23 | } |
24 | 24 |
|
25 | 25 | // Add additional slots for the MDC chip tokens, needed in Angular Material. |
| 26 | + $disabled-trailing-icon-opacity: 1; |
| 27 | + |
26 | 28 | @include token-utils.use-tokens(tokens-mdc-chip.$prefix, $mdc-chip-token-slots) { |
27 | 29 | .mat-mdc-chip-focus-overlay { |
28 | 30 | @include token-utils.create-token-slot(background, focus-state-layer-color); |
|
56 | 58 | @include token-utils.create-token-slot(opacity, with-avatar-disabled-avatar-opacity); |
57 | 59 | } |
58 | 60 |
|
| 61 | + .mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing { |
| 62 | + $disabled-trailing-icon-opacity: |
| 63 | + token-utils.get-token-variable(with-trailing-icon-disabled-trailing-icon-opacity); |
| 64 | + |
| 65 | + @include token-utils.create-token-slot( |
| 66 | + opacity, with-trailing-icon-disabled-trailing-icon-opacity); |
| 67 | + } |
| 68 | + |
59 | 69 | .mdc-evolution-chip--disabled.mdc-evolution-chip--selected .mdc-evolution-chip__checkmark { |
60 | 70 | @include token-utils.create-token-slot(opacity, with-icon-disabled-icon-opacity); |
61 | 71 | } |
|
81 | 91 | } |
82 | 92 |
|
83 | 93 | .mat-mdc-chip-remove { |
| 94 | + @include token-utils.create-token-slot(opacity, trailing-action-opacity); |
| 95 | + |
| 96 | + &:focus { |
| 97 | + @include token-utils.create-token-slot(opacity, trailing-action-focus-opacity); |
| 98 | + } |
| 99 | + |
84 | 100 | &::after { |
85 | 101 | @include token-utils.create-token-slot(background, trailing-action-state-layer-color); |
86 | 102 | } |
|
98 | 114 | @include token-utils.create-token-slot( |
99 | 115 | background, selected-trailing-action-state-layer-color); |
100 | 116 | } |
| 117 | + |
| 118 | + // If the trailing icon is a chip-remove button, we have to factor in the trailing action |
| 119 | + // opacity as well as the disabled opacity. |
| 120 | + .mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing { |
| 121 | + &.mat-mdc-chip-remove { |
| 122 | + opacity: calc( |
| 123 | + var(#{token-utils.get-token-variable(trailing-action-opacity)}) * |
| 124 | + var(#{$disabled-trailing-icon-opacity}) |
| 125 | + ); |
| 126 | + |
| 127 | + &:focus { |
| 128 | + opacity: calc( |
| 129 | + var(#{token-utils.get-token-variable(trailing-action-focus-opacity)}) * |
| 130 | + var(#{$disabled-trailing-icon-opacity}) |
| 131 | + ); |
| 132 | + } |
| 133 | + } |
| 134 | + } |
101 | 135 | } |
102 | 136 | } |
103 | 137 |
|
|
307 | 341 | } |
308 | 342 |
|
309 | 343 | .mat-mdc-chip-remove { |
310 | | - // Fades out the trailing icon slightly so that it can become darker when focused. |
311 | | - // The MDC theming has variables for this, but the focus/hover states don't seem to work. |
312 | | - opacity: 0.54; |
313 | | - |
314 | | - &:focus { |
315 | | - opacity: 1; |
316 | | - } |
317 | | - |
318 | 344 | &::before { |
319 | 345 | $default-border-width: focus-indicators-private.$default-border-width; |
320 | 346 | $offset: var(--mat-mdc-focus-indicator-border-width, #{$default-border-width}); |
|
0 commit comments