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: all-density, all-color and all-typography mixins should accept theme
With initial changes for the new density API, the individual mixins for
`all-color`, `all-density` and `all-typography` started only accepting
configurations for their actual theming system part.
This makes sense conceptually, but in favor of a better developer experience,
we also want to support that actual `$theme` objects can be specified.
The mixins then extract the individual configs from the theme objects.
This allows consumers to easily generate color styles for dark themes. e.g.
```
$my-theme: mat-light-theme((color: $color-config));
$my-dark-theme: mat-dark-theme((color: $color-confi));
// Includes color and default density. Typography is not included
// by default for backwards compatibility.
@include angular-material-theme($my-theme);
.dark-enabled {
// Note: Using the overall `theme` mixin here would cause
// density styles to be duplicated unnecessarily.
@include angular-material-color($my-dark-theme);
}
```
docs: update documentation for new api
refactor: update ng-add schematic
refactor: add color mixin for material-experimental and add theme support in bulk mixins
docs: guide edits
refactor: all-typography mixin should use all-theme to avoid c… (#19021)
As discussed in our team meeting, we want to get rid of the duplication
of individual theme, color, density and typography mixins
(similar to how we did it for all-density and all-color).
We couldn't simplify the all-typography mixin because the `core-theme`
mixin is stored in a file that relies on `all-typography`. This causes
a circular dependency when `all-typography` would then rely on `all-theme`.
To fix this, we split the `mat-core-theme` and `mat-core` mixin into
separate files. This avoids the circular dependency.
Additionally, a test has been created that ensures that the theming
bundle still exposes the necessary mixins/variables as needed.
0 commit comments