angular / angular/components

bug(mat-toolbar): mat-toolbar styles for elements like h1, h2, ... are not taking precedence over mat-typography

Aperta
#26,261 2 commenti 4 reazioni 0 assegnatari Vedi su GitHub
area: material/toolbar good first issue P3
Lingua principale
TypeScript
Stelle
25k
Fork
6.8k
Merge medio
1g 8h
PR unite (30g)
91

Descrizione

### Is this a regression?

- [ ] Yes, this behavior used to work in the previous version

### The previous version in which this bug was not present was

_No response_

### Description

When a header tag is used within mat-toolbar the stylings from the theme do not take precedence.
The default styles from mat-typography are still used. Therefore the margin is not reset to 0 and the font-size also differs.

![image](https://user-images.githubusercontent.com/5477981/207587289-b7ba6a95-9ae1-49f6-bfc7-3585a74cd285.png)

### Reproduction

https://stackblitz.com/edit/components-issue-t1dkvg

Steps to reproduce:
1. Apply mat-typography class to body
2. Add h1 tag with text to mat-toolbar

### Expected Behavior

Specific styles from mat-toolbar for these elements should take precedence. e.g. margin should be 0.

### Actual Behavior

Default mat-typography styles are used even though mat-toolbar would specify more accurate ones.

### Environment

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

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia con la riproduzione StackBlitz collegata e confronta gli stili applicati da mat-toolbar con quelli della classe mat-typography sul body. Traccia gli stili tipografici della toolbar per h1, h2 ed elementi simili; il lavoro è completato quando i relativi stili previsti della toolbar hanno la precedenza, incluso un margin pari a zero e la dimensione del carattere prevista.

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

Valutazione

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

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.