|
1 | 1 | @use '@angular/material' as mat; |
| 2 | +@use '@angular/cdk'; |
2 | 3 | @use '@material/list/evolution-mixins' as mdc-list-mixins; |
3 | 4 | @use '@material/list/evolution-variables' as mdc-list-variables; |
4 | 5 | @use 'sass:map'; |
|
25 | 26 | $height-config: map.get(mdc-list-variables.$one-line-item-density-config, height); |
26 | 27 | min-height: map.get($height-config, default); |
27 | 28 |
|
28 | | - // Workaround for https://goo.gl/pFmjJD in IE 11. Adds a pseudo |
29 | | - // element that will stretch the option to the correct height. See: |
30 | | - // https://connect.microsoft.com/IE/feedback/details/802625 |
31 | | - &::after { |
32 | | - display: inline-block; |
33 | | - min-height: inherit; |
34 | | - content: ''; |
35 | | - } |
36 | | - |
37 | 29 | &.mdc-list-item--disabled { |
38 | 30 | // This is the same as `mdc-list-mixins.list-disabled-opacity` which |
39 | 31 | // we can't use directly, because it comes with some selectors. |
|
88 | 80 | text-decoration: inherit; |
89 | 81 | text-transform: inherit; |
90 | 82 | } |
| 83 | + |
| 84 | + @include cdk.high-contrast(active, off) { |
| 85 | + // In single selection mode, the selected option is indicated by changing its |
| 86 | + // background color, but that doesn't work in high contrast mode. We add an |
| 87 | + // alternate indication by rendering out a circle. |
| 88 | + &.mdc-list-item--selected:not(.mat-mdc-option-multiple)::after { |
| 89 | + $size: 10px; |
| 90 | + content: ''; |
| 91 | + position: absolute; |
| 92 | + top: 50%; |
| 93 | + right: mdc-list-variables.$side-padding; |
| 94 | + transform: translateY(-50%); |
| 95 | + width: $size; |
| 96 | + height: 0; |
| 97 | + border-bottom: solid $size; |
| 98 | + border-radius: $size; |
| 99 | + } |
| 100 | + |
| 101 | + [dir='rtl'] &.mdc-list-item--selected:not(.mat-mdc-option-multiple)::after { |
| 102 | + right: auto; |
| 103 | + left: mdc-list-variables.$side-padding; |
| 104 | + } |
| 105 | + } |
91 | 106 | } |
92 | 107 |
|
93 | 108 | // For options, render the focus indicator when the class .mat-mdc-option-active is present. |
|
0 commit comments