|
1 | 1 | @use '../core/theming/theming'; |
| 2 | +@use '../core/theming/inspection'; |
2 | 3 | @use '../core/typography/typography'; |
3 | 4 | @use '../core/tokens/m2/mat/legacy-button-toggle' as tokens-mat-legacy-button-toggle; |
4 | 5 | @use '../core/tokens/m2/mat/standard-button-toggle' as tokens-mat-standard-button-toggle; |
5 | 6 | @use '../core/tokens/token-utils'; |
6 | 7 | @use '../core/style/sass-utils'; |
7 | 8 |
|
8 | | -@mixin color($config-or-theme) { |
9 | | - $config: theming.get-color-config($config-or-theme); |
10 | | - |
| 9 | +@mixin color($theme) { |
11 | 10 | @include sass-utils.current-selector-or-root() { |
12 | 11 | @include token-utils.create-token-values(tokens-mat-legacy-button-toggle.$prefix, |
13 | | - tokens-mat-legacy-button-toggle.get-color-tokens($config)); |
| 12 | + tokens-mat-legacy-button-toggle.get-color-tokens($theme)); |
14 | 13 | @include token-utils.create-token-values(tokens-mat-standard-button-toggle.$prefix, |
15 | | - tokens-mat-standard-button-toggle.get-color-tokens($config)); |
| 14 | + tokens-mat-standard-button-toggle.get-color-tokens($theme)); |
16 | 15 | } |
17 | 16 | } |
18 | 17 |
|
19 | | -@mixin typography($config-or-theme) { |
20 | | - $config: typography.private-typography-to-2014-config( |
21 | | - theming.get-typography-config($config-or-theme)); |
22 | | - |
| 18 | +@mixin typography($theme) { |
23 | 19 | @include sass-utils.current-selector-or-root() { |
24 | 20 | @include token-utils.create-token-values(tokens-mat-legacy-button-toggle.$prefix, |
25 | | - tokens-mat-legacy-button-toggle.get-typography-tokens($config)); |
| 21 | + tokens-mat-legacy-button-toggle.get-typography-tokens($theme)); |
26 | 22 | @include token-utils.create-token-values(tokens-mat-standard-button-toggle.$prefix, |
27 | | - tokens-mat-standard-button-toggle.get-typography-tokens($config)); |
| 23 | + tokens-mat-standard-button-toggle.get-typography-tokens($theme)); |
28 | 24 | } |
29 | 25 | } |
30 | 26 |
|
31 | | -@mixin density($config-or-theme) { |
32 | | - $density-scale: theming.get-density-config($config-or-theme); |
33 | | - |
| 27 | +@mixin density($theme) { |
34 | 28 | @include sass-utils.current-selector-or-root() { |
35 | 29 | @include token-utils.create-token-values(tokens-mat-legacy-button-toggle.$prefix, |
36 | | - tokens-mat-legacy-button-toggle.get-density-tokens($density-scale)); |
| 30 | + tokens-mat-legacy-button-toggle.get-density-tokens($theme)); |
37 | 31 | @include token-utils.create-token-values(tokens-mat-standard-button-toggle.$prefix, |
38 | | - tokens-mat-standard-button-toggle.get-density-tokens($density-scale)); |
| 32 | + tokens-mat-standard-button-toggle.get-density-tokens($theme)); |
39 | 33 | } |
40 | 34 | } |
41 | 35 |
|
42 | | -@mixin theme($theme-or-color-config) { |
43 | | - $theme: theming.private-legacy-get-theme($theme-or-color-config); |
| 36 | +@mixin theme($theme) { |
44 | 37 | @include theming.private-check-duplicate-theme-styles($theme, 'mat-button-toggle') { |
45 | | - $color: theming.get-color-config($theme); |
46 | | - $density: theming.get-density-config($theme); |
47 | | - $typography: theming.get-typography-config($theme); |
48 | | - |
49 | | - @if $color != null { |
50 | | - @include color($color); |
| 38 | + @if inspection.theme-has($theme, color) { |
| 39 | + @include color($theme); |
51 | 40 | } |
52 | | - @if $density != null { |
53 | | - @include density($density); |
| 41 | + @if inspection.theme-has($theme, density) { |
| 42 | + @include density($theme); |
54 | 43 | } |
55 | | - @if $typography != null { |
56 | | - @include typography($typography); |
| 44 | + @if inspection.theme-has($theme, typography) { |
| 45 | + @include typography($theme); |
57 | 46 | } |
58 | 47 | } |
59 | 48 | } |
0 commit comments