|
8 | 8 | @use '../radio/m2-radio'; |
9 | 9 | @use './m2-list'; |
10 | 10 | @use './m3-list'; |
11 | | -@use '../core/tokens/m2-utils'; |
12 | 11 |
|
13 | 12 | @mixin base($theme) { |
14 | 13 | $tokens: m2-list.get-unthemable-tokens(); |
|
28 | 27 | @include token-utils.values($tokens); |
29 | 28 |
|
30 | 29 | @if inspection.get-theme-version($theme) != 1 { |
31 | | - .mdc-list-item__start, |
32 | | - .mdc-list-item__end { |
33 | | - $tokens: m2-radio.get-color-tokens($theme, primary); |
34 | | - @include token-utils.values($tokens); |
35 | | - } |
| 30 | + .mat-mdc-selection-list { |
| 31 | + @include token-utils.values(m2-radio.get-color-tokens($theme, primary)); |
| 32 | + @include token-utils.values(m2-checkbox.get-color-tokens($theme, primary)); |
36 | 33 |
|
37 | | - .mat-accent { |
38 | | - .mdc-list-item__start, |
39 | | - .mdc-list-item__end { |
40 | | - $tokens: m2-radio.get-color-tokens($theme, secondary); |
41 | | - @include token-utils.values($tokens); |
| 34 | + .mat-accent { |
| 35 | + @include token-utils.values(m2-radio.get-color-tokens($theme, secondary)); |
| 36 | + @include token-utils.values(m2-checkbox.get-color-tokens($theme, secondary)); |
42 | 37 | } |
43 | | - } |
44 | 38 |
|
45 | | - .mat-warn { |
46 | | - .mdc-list-item__start, |
47 | | - .mdc-list-item__end { |
48 | | - $tokens: m2-radio.get-color-tokens($theme, error); |
49 | | - @include token-utils.values($tokens); |
50 | | - } |
51 | | - } |
52 | | - |
53 | | - .mat-mdc-list-option { |
54 | | - $tokens: m2-checkbox.get-color-tokens($theme, primary); |
55 | | - @include token-utils.values($tokens); |
56 | | - } |
57 | | - |
58 | | - .mat-mdc-list-option.mat-accent { |
59 | | - $tokens: m2-checkbox.get-color-tokens($theme, secondary); |
60 | | - @include token-utils.values($tokens); |
61 | | - } |
62 | | - |
63 | | - .mat-mdc-list-option.mat-warn { |
64 | | - $tokens: m2-checkbox.get-color-tokens($theme, error); |
65 | | - @include token-utils.values($tokens); |
66 | | - } |
67 | | - |
68 | | - // There is no token for activated color on nav list. |
69 | | - // TODO(mmalerba): Add a token to MDC or make a custom one. |
70 | | - .mat-mdc-list-base.mat-mdc-list-base { |
71 | | - .mdc-list-item--selected, |
72 | | - .mdc-list-item--activated { |
73 | | - .mdc-list-item__primary-text, |
74 | | - .mdc-list-item__start { |
75 | | - color: inspection.get-theme-color($theme, primary); |
76 | | - } |
77 | | - } |
78 | | - } |
79 | | - |
80 | | - // TODO(mmalerba): Leaking styles from the old MDC list mixins used in other components can |
81 | | - // cause opacity issues, so we need this override for now. We can remove it when all |
82 | | - // Angular Material components stop using the old MDC mixins. |
83 | | - .mat-mdc-list-base .mdc-list-item--disabled { |
84 | | - .mdc-list-item__start, |
85 | | - .mdc-list-item__content, |
86 | | - .mdc-list-item__end { |
87 | | - opacity: 1; |
| 39 | + .mat-warn { |
| 40 | + @include token-utils.values(m2-radio.get-color-tokens($theme, error)); |
| 41 | + @include token-utils.values(m2-checkbox.get-color-tokens($theme, error)); |
88 | 42 | } |
89 | 43 | } |
90 | 44 | } |
|
106 | 60 | $tokens: m2-radio.get-density-tokens($theme); |
107 | 61 | @include token-utils.values($tokens); |
108 | 62 | } |
109 | | - |
110 | | - // TODO(mmalerba): This is added to maintain the same style MDC used prior to the token-based |
111 | | - // API, to avoid screenshot diffs. We should remove it in favor of following MDC's current |
112 | | - // style, or add custom tokens for it. |
113 | | - .mat-mdc-list-item { |
114 | | - &.mdc-list-item--with-leading-avatar, |
115 | | - &.mdc-list-item--with-leading-checkbox, |
116 | | - &.mdc-list-item--with-leading-icon { |
117 | | - &.mdc-list-item--with-one-line { |
118 | | - height: map.get( |
119 | | - ( |
120 | | - 0: 56px, |
121 | | - -1: 52px, |
122 | | - -2: 48px, |
123 | | - -3: 44px, |
124 | | - -4: 40px, |
125 | | - -5: 40px, |
126 | | - ), |
127 | | - $density-scale |
128 | | - ); |
129 | | - } |
130 | | - |
131 | | - &.mdc-list-item--with-two-lines { |
132 | | - height: map.get( |
133 | | - ( |
134 | | - 0: 72px, |
135 | | - -1: 68px, |
136 | | - -2: 64px, |
137 | | - -3: 60px, |
138 | | - -4: 56px, |
139 | | - -5: 56px, |
140 | | - ), |
141 | | - $density-scale |
142 | | - ); |
143 | | - } |
144 | | - } |
145 | | - } |
146 | 63 | } |
147 | 64 | } |
148 | 65 |
|
|
153 | 70 | } |
154 | 71 |
|
155 | 72 | @include token-utils.values($tokens); |
156 | | - |
157 | | - @if inspection.get-theme-version($theme) != 1 { |
158 | | - // MDC does not have tokens for the subheader. |
159 | | - // TODO(mmalerba): Discuss with MDC about adding them, or create custom tokens. |
160 | | - .mdc-list-group__subheader { |
161 | | - $system: m2-utils.get-system($theme); |
162 | | - font: map.get($system, label-large); |
163 | | - letter-spacing: map.get($system, label-large-tracking); |
164 | | - } |
165 | | - } |
166 | 73 | } |
167 | 74 |
|
168 | 75 | /// Defines the tokens that will be available in the `overrides` mixin and for docs extraction. |
|
0 commit comments