|
2 | 2 | @use '../../../style/elevation';
|
3 | 3 | @use '../../../style/sass-utils';
|
4 | 4 | @use '../../../theming/inspection';
|
| 5 | +@use '../../../theming/theming'; |
5 | 6 | @use '../../token-utils';
|
6 | 7 |
|
7 | 8 | // The prefix used to generate the fully qualified name for tokens in this file.
|
@@ -40,8 +41,6 @@ $prefix: (mdc, switch);
|
40 | 41 | track-width: 36px,
|
41 | 42 | // Width and height of icon when unselected.
|
42 | 43 | unselected-icon-size: 18px,
|
43 |
| - // The diameter of the handle ripple. |
44 |
| - state-layer-size: 40px, |
45 | 44 | // Opacity of ripple when selected and focused.
|
46 | 45 | selected-focus-state-layer-opacity: 0.12,
|
47 | 46 | // Opacity of ripple when selected and on hover.
|
@@ -164,7 +163,17 @@ $prefix: (mdc, switch);
|
164 | 163 |
|
165 | 164 | // Tokens that can be configured through Angular Material's density theming API.
|
166 | 165 | @function get-density-tokens($theme) {
|
167 |
| - @return (); |
| 166 | + $scale: theming.clamp-density(inspection.get-theme-density($theme), -3); |
| 167 | + |
| 168 | + @return ( |
| 169 | + // The diameter of the handle ripple. |
| 170 | + state-layer-size: map.get(( |
| 171 | + 0: 40px, |
| 172 | + -1: 36px, |
| 173 | + -2: 32px, |
| 174 | + -3: 28px, |
| 175 | + ), $scale) |
| 176 | + ); |
168 | 177 | }
|
169 | 178 |
|
170 | 179 | // Combines the tokens generated by the above functions into a single map with placeholder values.
|
|
0 commit comments