angular / angular/components

bug(mat-dialog): default Dialog backdrop color is hardcoded black 32% instead of using mat-sys-scrim

Aperta
#33,578 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
area: cdk/overlay gemini-triaged P3
Lingua principale
TypeScript
Stelle
25k
Fork
6.8k
Merge medio
1g 8h
PR unite (30g)
91

Descrizione

### Description

Not sure if this is a bug or intentional, please advise

The default Angular Material behavior when opening a Dialog is to add a 32% opacity black scrim for the overlay. This is not in any way customizable and instead is hardcoded in the Angular CDK overlay implementation: https://github.com/angular/components/blob/501d6744b377e1ef7d1cf7e86edcc0eedbf755e7/src/cdk/overlay/_index.scss#L9

Since there is an existing `mat-sys-scrim` token for this exact purpose I recommend it be used for customization purposes and for the ability to account for light and dark themes.

### Reproduction

https://material.angular.dev/components/dialog/overview

### Expected Behavior

`mat-sys-scrim` token is used for scrims

### Actual Behavior

Hardcoded 32% opacity black value is used for the scrim

### Environment

- Angular: v22
- CDK/Material: v22
- Browser(s): any
- Operating System (e.g. Windows, macOS, Ubuntu): any

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Start with src/cdk/overlay/_index.scss at the referenced backdrop styling and inspect the Angular Material dialog overview reproduction. Trace how the dialog overlay receives its scrim styling and verify whether the existing mat-sys-scrim token is available there. Done means the default scrim uses mat-sys-scrim while preserving the expected dialog behavior in light and dark themes.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
angular, scss, typescript
Ambito
frontend
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
68/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.