angular / components

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

feat(Sidenav): Add additional palette definitions on a component basis #21150

Open intellix opened 3 years ago

intellix commented 3 years ago

Feature Description

We would like to theme various components without affecting another unrelated component. One particular example, is to change the background colour of the sidenav without changing the dialog background. Currently the sidenav/drawer palette variable uses the same background variable used for dialog.

Sidenav is one example, but I've seen other components re-using variables from other components:

https://github.com/angular/components/blob/34a43f62233790d083f2c0a041fc6740640584cd/src/material/sidenav/_sidenav-theme.scss#L14-L17

These two in particular are obvious to me:

$drawer-background-color: mat-color($background, drawer); 
$drawer-push-background-color: mat-color($background, drawer); 

And in the palette it's just an extra definition:

$mat-dark-theme-background: (
  ...
  dialog:     map-get($mat-grey, 800),
  drawer:     map-get($mat-grey, 800),
);

Use Case

Our site is built dynamically using a CMS and we would like to offer the ability to change the background colour of the drawer without affecting the background of modals.

I've been meaning to write this issue for years now but keep forgetting... so here it is

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.