Ability to set more than just primary 500, accent 500 or warn 500 as button colors
See original GitHub issueBug, feature request, or proposal:
Feature request
What is the expected behavior?
It would be nice to be able to specify a color level from a specified palette to a button using the color
attribute. I sometimes want to be able to make a FAB primary 400 or something like that
What is the current behavior?
You can set a button to primary
, accent
, or warn
and the button component picks the 500 level of that palette
What are the steps to reproduce?
Providing a Plunker (or similar) is the best way to get the team to see your issue. Plunker template: https://goo.gl/DlHd6U
What is the use-case or motivation for changing an existing behavior?
We don’t always want to use the 500 level of our palettes for styling buttons or other components
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Angular material beta 8
Is there anything else we should know?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:14
- Comments:12 (8 by maintainers)
Top Results From Across the Web
How to use custom material color palettes in Angular?
Angular Material themes are based on defining your primary , warn and accent colors. The Documentation on Angular Material Theming are very ...
Read more >Palette - Material UI - MUI
The palette enables you to modify the color of the components to suit your brand. ... It provides more ways to accent and...
Read more >Customizing Colors - Tailwind CSS
Customizing the default color palette for your project. Default color palette. Tailwind includes an expertly-crafted default color palette out-of-the-box that ...
Read more >Colors - Bootstrap
Colors. Convey meaning through color with a handful of color utility classes. Includes support for styling links with hover states, too.
Read more >Custom theming in Angular Material - mobilemotion.eu
Angular Material decides which one to display for what part of a user control, the default value is always the shade marked as...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Interesting, didn’t know that it only used the default. I’m not sure that would solve this issue though because I do want most of the components to be styled using 500, but it would be nice to choose another color for one or two things in certain situations. Currently I’m just overriding the color by defining a style for
.mat-fab.mat-primary
in the component where the fab is used and setting the color there. That will probably break at some point either due to selector name changes or shadow DOM stuff@bradringel I don’t know why this didn’t occur to me before:
You can create two themes (see the part about multiple themes), like $my-main-theme, and $my-secondary-theme. In the secondary one, use alternate palette colors (like indigo-400 for primary).
Then just wrap your FAB or whatever with that class