Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 task
daviian opened this issue Dec 14, 2022 · 1 comment
Labels
area: material/toolbar good first issue This issue is a good place to start for first time contributors to the project P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@daviian
Copy link

daviian commented Dec 14, 2022

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

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
@daviian daviian added the needs triage This issue needs to be triaged by the team label Dec 14, 2022
@wagnermaciel wagnermaciel added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent area: material/toolbar good first issue This issue is a good place to start for first time contributors to the project and removed needs triage This issue needs to be triaged by the team labels May 3, 2023
@phs-sakshi
Copy link

Can I work on this issue?

arnelumandapjr added a commit to arnelumandapjr/components that referenced this issue May 14, 2023
…-component-themes() in themes.

This will allow component specific typography styles take precedence over global typography styles, such in the case of material/toolbar which has specific style definition for typography.

Fixes angular#26261
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: material/toolbar good first issue This issue is a good place to start for first time contributors to the project P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
3 participants