You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(material-experimental/theming): condense matx.theme and matx.retheme into a single mixin (#27309)
Rather than having a separate mixin for "retheming" we have a single
mixin `matx.theme` that can either emit fallback token defaults or not
depending on how its configured. Added `matx.token-defaults` which can
be used to configure the fallbacks.
- These functions are used to specify which tokens should be applied by the theming mixins _and_ to customize the tokens used in that component to something other than the value from the token set
24
-
- So far the following component theme configuration functions have been implements:
23
+
- These functions are used to specify which tokens should be applied by the `matx.theme` mixin _and_ to customize the tokens used in that component to something other than the value from the token set
24
+
-`matx.token-defaults` is a special configuration function used to set the default token values that will be used for any components that are configured as part of the same mixin call, if no `matx.token-defaults` config is specified, only tokens for the explicitly customized properties will be emitted
25
+
- So far the following component theme configuration functions have been implemented:
25
26
-`matx.checkbox` configures tokens for the mat-checkbox to be applied
26
27
-`matx.card` configures tokens for the mat-card to be applied
27
-
- The returned configurations from these functions are passed to `matx.theme` or `matx.retheme`
28
-
- If no arguments are passed, the configuration instructs the mixin to just output the default value for all of the tokens needed by that component
29
-
- The functions can also accept a map of customizations as an argument.
28
+
- The returned configurations from these functions are passed to `matx.theme`
29
+
- The functions optionally accept a map of customizations as an argument which allows overriding properties tha would otherwise be derived from the default tokens.
30
30
- Each function has its own set of supported map keys that can be used to customize the value of the underlying tokens
31
-
- The map keys are a higher level API then the tokens, some of the keys may result in a single token being change, but some may change multiple tokens
31
+
- The map keys are a higher level API then the tokens, some the keys may result in a single token being change, but some may change multiple tokens
32
32
- For supported map keys (TODO: have docs for these):
33
33
- See `$_customization-resolvers`[here](https://github.com/angular/components/blob/main/src/material-experimental/theming/_checkbox.scss) for `matx.checkbox`
34
34
- See `$_customization-resolvers`[here](https://github.com/angular/components/blob/main/src/material-experimental/theming/_card.scss) for `matx.card`
35
35
36
36
## Theming mixins
37
-
- There are 2 mixins used for theming apps
38
-
-`matx.theme` is intended to apply the full theme for some components, with all tokens they need to function.
39
-
-`matx.retheme` is intended to re-apply specific tokens to change the appearance for some components by overriding the tokens applied by `matx.theme`.
0 commit comments