Skip to content

bug(button): mat-buttons in toolbar don't use toolbars text color #26063

Closed
@beckerjohannes

Description

@beckerjohannes

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

14.2.7

Description

When using a mat-button inside a mat-toolbar with primary color (like the code snippet below) the text color of the mat-button is not the same as the toolbar text color. For `mat-icon-button' it is correct.

<mat-toolbar color="primary"
  ><span>My App</span>
  <button mat-button>Button 1</button>
  <button mat-button>Button 2</button>
  <button mat-icon-button>
    <mat-icon>share</mat-icon>
  </button>
</mat-toolbar>

Reproduction

Example with Angular 15:
https://stackblitz.com/edit/components-issue-fonhmb?file=src/app/example-component.html

Expected Behavior

Buttons having the same text color as the regular navbar text and icon buttons.

Actual Behavior

image

Environment

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

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/toolbar

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions