angular / components

Component infrastructure and Material Design components for Angular
https://material.angular.io
MIT License
24.33k stars 6.73k forks source link

feat(mat-experimental): theme components the MDC way #23299

Open austinw-fineart opened 3 years ago

austinw-fineart commented 3 years ago

Feature Description

With the MDC components in Angular Material, I'd like to be able to use my existing theme with them. The experimental package currently has mixins for theming the MDC components using... a palette, from Material 1. My understanding is that this exists for legacy reasons, but I would like a way to have Angular Material consume theming options from MDC Web, or at the very least something more inline with what MDC Web offers.

Use Case

In MDC Web, theming is done like this:

@use "@material/theme/theme-color" with (
  $primary: #FEDBD0,
  $on-primary: #442C2E,
);
@use '@material/typography/variables' as typography-variables with (
  $styles-button: ( letter-spacing: normal ),
);

Compared to whatever this is:

@use '~@angular/material' as mat;
@use '~@angular/material-experimental' as mat-experimental;
$my-primary: mat.define-palette(mat.$indigo-palette);
$my-accent: mat.define-palette(mat.$pink-palette, A200, A100, A400);
$my-theme: mat.define-light-theme((
  color: (
    primary: $my-primary,
    accent: $my-accent
  ),
  typography: mat-experimental.define-mdc-typography-config(),
));
@include mat-experimental.all-mdc-component-themes($my-theme);
angular-robot[bot] commented 2 years ago

Just a heads up that we kicked off a community voting process for your feature request. There are 20 days until the voting process ends.

Find more details about Angular's feature request process in our documentation.

angular-robot[bot] commented 2 years ago

Thank you for submitting your feature request! Looks like during the polling process it didn't collect a sufficient number of votes to move to the next stage.

We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular's scope, we'd encourage you to collaborate with the community on publishing it as an open source package.

You can find more details about the feature request process in our documentation.