angular / angular/components

feat(theme-generator): Add possibility to force custom color @angular/material:theme-color

Open
#30,167 20 comments 18 reactions 0 assignees View on GitHub
area: ng-generate feature P4
Dominant language
TypeScript
Stars
25k
Forks
6.8k
Avg merge
1d 8h
Merged PRs (30d)
91

Description

### Feature Description

My problem is that I still can't understand how `@angular/material:theme-color` works. In the terminal, I need to provide colors for primary, secondary, and tertiary. For each one, I specify a single color, like #ff9500, because that's what I want.

`What HEX color should be used to generate the M3 theme? It will represent your primary color palette. (ex. #ffffff) **#005dba**
What HEX color should be used represent the secondary color palette? (Leave blank to use generated colors from Material) **#005dba**
What HEX color should be used represent the tertiary color palette? (Leave blank to use generated colors from Material) **#005dba**`

However, when generating the theme, I see that it creates color palettes, but when I try to get just my color, I use **`--mat-sys-primary`.** Unfortunately, it appears significantly darker (#8c5000), and I don't know which variable the color is actually hidden under. I have the impression that due to the low contrast, it is being artificially darkened. However, I selected the option not to generate mixins with high contrast. I would like to be able to use exactly that color without worrying about contrast. Currently, I am forced to manually change all the system token colors because the generated palette still interferes too much with what I want to achieve, taking away the flexibility I need in this case.

### Use Case

It would be great to be able to specify in the terminal that I want exactly the colors I mention, without any interference.

Contributor guide

Open the contributing guide

Research direction

Start with the @angular/material:theme-color generator and its terminal prompts, then compare the requested colors with the generated --mat-sys-primary value. Done means users can opt to use the specified colors exactly, without generated palette or contrast adjustments overriding them.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript
Domain
cli, design, frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.