Skip to content

bug(Material): Button theme-overrrides typography not working #31719

@mattiLeBlanc

Description

@mattiLeBlanc

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

20.1.3

Description

@andrewseguin I reported this issue before: #31191

My button filled is not getting the override of label-large since I upgraded to v20.1.7.

Reproduction

I have:

@include mat.theme-overrides((
...
label-large: 600 1.25rem/1.5rem 'Inter Tight',
// for buttons above line doesnt work, not sure anymore where this was happening
label-large-font: 'Inter Tight',
label-large-size: 1.25rem,
label-large-line-height: 1.5rem,
label-large-weight: 600,
...
))

This worked for angular 20.1.3 and below.
label-large works for any component using label-large but for buttons it needed to be defined separately to override the buttons font size.

After upgrading to 20.1.7 none of these overrides work anymore.
--mat-sys-label-large-size is now 0.875 and not 1.25 rem.

The only way I can change the size is using

mat.button-overrides((
filled-label-text-size: 1.25rem
))

affects --mat-button-filled-label-text-size

Expected Behavior

I expect --mat-sys-label-large-size to be 1.25.

Actual Behavior

After upgrading to 20.1.7 none of these overrides work anymore.
--mat-sys-label-large-size is now 0.875 and not 1.25 rem.

Environment

  • Angular: 20.1.7
  • CDK/Material: 20.1.7
  • Browser(s): Chrome, Safari
  • Operating System (e.g. Windows, macOS, Ubuntu): macOS

Metadata

Metadata

Assignees

Labels

needs: discussionFurther discussion with the team is needed before proceeding

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions