1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 | @use 'sass:map';
|
24 | @use '@material/theme/theme';
|
25 | @use '@material/theme/keys';
|
26 | @use '@material/tokens/resolvers';
|
27 | @use './chip-theme';
|
28 |
|
29 | $_light-theme: (
|
30 | container-shape: null,
|
31 | container-height: null,
|
32 | flat-container-elevation: null,
|
33 | flat-outline-color: null,
|
34 | flat-outline-width: null,
|
35 | elevated-container-elevation: null,
|
36 | elevated-container-color: null,
|
37 | elevated-container-shadow-color: null,
|
38 | container-surface-tint-layer-color: null,
|
39 | label-text-font: null,
|
40 | label-text-line-height: null,
|
41 | label-text-size: null,
|
42 | label-text-weight: null,
|
43 | label-text-tracking: null,
|
44 | label-text-color: null,
|
45 | with-icon-icon-size: null,
|
46 | with-icon-icon-color: null,
|
47 | flat-disabled-outline-color: null,
|
48 | flat-disabled-outline-opacity: null,
|
49 | disabled-label-text-color: null,
|
50 | disabled-label-text-opacity: null,
|
51 | with-icon-disabled-icon-color: null,
|
52 | with-icon-disabled-icon-opacity: null,
|
53 | elevated-disabled-container-elevation: null,
|
54 | elevated-disabled-container-color: null,
|
55 | elevated-disabled-container-opacity: null,
|
56 | hover-state-layer-color: null,
|
57 | hover-state-layer-opacity: null,
|
58 | hover-label-text-color: null,
|
59 | with-icon-hover-icon-color: null,
|
60 | elevated-hover-container-elevation: null,
|
61 | focus-state-layer-color: null,
|
62 | focus-state-layer-opacity: null,
|
63 | focus-label-text-color: null,
|
64 | flat-focus-outline-color: null,
|
65 | with-icon-focus-icon-color: null,
|
66 | elevated-focus-container-elevation: null,
|
67 | pressed-state-layer-color: null,
|
68 | pressed-state-layer-opacity: null,
|
69 | pressed-label-text-color: null,
|
70 | with-icon-pressed-icon-color: null,
|
71 | elevated-pressed-container-elevation: null,
|
72 | );
|
73 |
|
74 | $_custom-property-prefix: 'assist-chip';
|
75 |
|
76 | @mixin theme($theme, $resolvers: resolvers.$material) {
|
77 | @include theme.validate-theme($_light-theme, $theme);
|
78 |
|
79 |
|
80 | @each $key
|
81 | in (
|
82 | flat-container-elevation,
|
83 | elevated-container-elevation,
|
84 | elevated-disabled-container-elevation,
|
85 | elevated-hover-container-elevation,
|
86 | elevated-focus-container-elevation,
|
87 | elevated-pressed-container-elevation
|
88 | )
|
89 | {
|
90 | $value: map.get($theme, $key);
|
91 | @if $value {
|
92 | $theme: map.set(
|
93 | $theme,
|
94 | $key,
|
95 | meta.call(
|
96 | $elevation-resolver: map.get($resolvers, elevation),
|
97 | $elevation: $value,
|
98 | $shadow-color: map.get($theme, elevated-container-shadow-color),
|
99 | )
|
100 | );
|
101 | }
|
102 | }
|
103 |
|
104 | @include keys.declare-custom-properties(
|
105 | $theme,
|
106 | $prefix: $_custom-property-prefix
|
107 | );
|
108 | }
|
109 |
|
110 | @mixin theme-styles($theme, $resolvers: resolvers.$material) {
|
111 | @include theme.validate-theme($_light-theme, $theme);
|
112 | $theme: keys.create-theme-properties(
|
113 | $theme,
|
114 | $prefix: $_custom-property-prefix
|
115 | );
|
116 | @include chip-theme.theme-styles($theme, $resolvers: $resolvers);
|
117 | }
|