|
1 | | -@use '@material/list' as mdc-list; |
| 1 | +@use '@material/list/evolution-mixins' as mdc-list-mixins; |
| 2 | +@use '@material/list/evolution-variables' as mdc-list-variables; |
2 | 3 | @use 'sass:map'; |
3 | 4 | @use '../../mdc-helpers/mdc-helpers'; |
4 | 5 | @use '../../../material/core/style/vendor-prefixes'; |
5 | 6 | @use '../../../cdk/a11y'; |
6 | 7 | @use '../../../material/core/style/layout-common'; |
7 | 8 |
|
8 | 9 | .mat-mdc-option { |
9 | | - // Note that we include this private mixin, because the public |
10 | | - // one adds a bunch of styles that we aren't using for the menu. |
11 | | - @include mdc-list.deprecated-item-base_; |
12 | | - @include mdc-list.deprecated-list-item-padding-variant( |
13 | | - mdc-list.$deprecated-textual-variant-config, $query: mdc-helpers.$mat-base-styles-query); |
14 | | - @include mdc-list.deprecated-item-disabled-text-opacity( |
15 | | - mdc-list.$deprecated-text-disabled-opacity, $query: mdc-helpers.$mat-base-styles-query); |
| 10 | + @include mdc-list-mixins.item-base; |
| 11 | + @include mdc-list-mixins.item-spacing( |
| 12 | + mdc-list-variables.$side-padding, $query: mdc-helpers.$mat-base-styles-query); |
16 | 13 | @include vendor-prefixes.user-select(none); |
| 14 | + cursor: pointer; |
17 | 15 |
|
18 | 16 | // Set the `min-height` here ourselves, instead of going through |
19 | | - // the `mdc-list-list-item-height-variant` mixin, because it sets a `height` |
| 17 | + // the `mdc-list-one-line-item-density` mixin, because it sets a `height` |
20 | 18 | // which doesn't work well with multi-line options. |
21 | | - min-height: map.get(mdc-list.$deprecated-textual-variant-config, single-line-height); |
| 19 | + $height-config: map.get(mdc-list-variables.$one-line-item-density-config, height); |
| 20 | + min-height: map.get($height-config, default); |
22 | 21 |
|
23 | 22 | // Workaround for https://goo.gl/pFmjJD in IE 11. Adds a pseudo |
24 | 23 | // element that will stretch the option to the correct height. See: |
|
29 | 28 | content: ''; |
30 | 29 | } |
31 | 30 |
|
32 | | - &:not(.mdc-deprecated-list-item--disabled) { |
33 | | - cursor: pointer; |
| 31 | + &.mdc-list-item--disabled { |
| 32 | + // This is the same as `mdc-list-mixins.list-disabled-opacity` which |
| 33 | + // we can't use directly, because it comes with some selectors. |
| 34 | + opacity: mdc-list-variables.$content-disabled-opacity; |
| 35 | + cursor: default; |
34 | 36 | } |
35 | 37 |
|
36 | 38 | // Note that we bump the padding here, rather than padding inside the |
37 | 39 | // group so that ripples still reach to the edges of the panel. |
38 | 40 | .mat-mdc-optgroup &:not(.mat-mdc-option-multiple) { |
39 | | - padding-left: mdc-list.$deprecated-side-padding * 2; |
| 41 | + padding-left: mdc-list-variables.$side-padding * 2; |
40 | 42 |
|
41 | 43 | [dir='rtl'] & { |
42 | | - padding-left: mdc-list.$deprecated-side-padding; |
43 | | - padding-right: mdc-list.$deprecated-side-padding * 2; |
| 44 | + padding-left: mdc-list-variables.$side-padding; |
| 45 | + padding-right: mdc-list-variables.$side-padding * 2; |
44 | 46 | } |
45 | 47 | } |
46 | 48 |
|
47 | 49 | .mat-pseudo-checkbox { |
48 | | - margin-right: mdc-list.$deprecated-side-padding; |
| 50 | + margin-right: mdc-list-variables.$side-padding; |
49 | 51 |
|
50 | 52 | [dir='rtl'] & { |
51 | 53 | margin-right: 0; |
52 | | - margin-left: mdc-list.$deprecated-side-padding; |
| 54 | + margin-left: mdc-list-variables.$side-padding; |
53 | 55 | } |
54 | 56 | } |
55 | 57 |
|
|
0 commit comments