Skip to content

bug(MatRadioButton): MatRadioButton's text color does not follow the color scheme when in MatMenu #19235

Closed
@dang-khoa-tran

Description

@dang-khoa-tran

Reproduction

Use StackBlitz to reproduce your issue: https://stackblitz.com/edit/components-issue-cxaoov

Steps to reproduce:

  1. Create custom dark theme
  2. Create MatMenu
  3. Create MatRadioButton in MatMenu

Expected Behavior

What behavior were you expecting to see?

MatRadioButton's text color should be white (or at least light)

Actual Behavior

What behavior did you actually see?

MatRadioButton's text color is black

Environment

  • Angular: 9
  • CDK/Material: Yes, both
  • Browser(s): Brave v1.7.98, Safari 13.1.1
  • Operating System (e.g. Windows, macOS, Ubuntu): macOS

Possible fixes

I fixed it for me by creating following mixin

@mixin mat-radio-theme-fix($theme) {
	$foreground: map-get($theme, foreground);

	mat-radio-button {
		color: map-get($foreground, text);
	}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions