Skip to content

Commit f20122a

Browse files
authored
fix(material/checkbox): incorrect text color when placed inside an overlay with a dark theme (#19054)
This is along the same lines as #18742. The checkbox inherits its text color from the closest parent which may not be correct once the element is moved out into an overlay.
1 parent f05e65a commit f20122a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/material/checkbox/_checkbox-theme.scss

+6
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@
3232
fill: $checkbox-mark-color;
3333
}
3434

35+
.mat-checkbox-label {
36+
// Explicitly set the text color since the checkbox may be
37+
// inside an overlay that doesn't have the proper theme text color.
38+
color: theming.get-color-from-palette($foreground, 'text');
39+
}
40+
3541
.mat-checkbox-checkmark-path {
3642
// !important is needed here because a stroke must be set as an
3743
// attribute on the SVG in order for line animation to work properly.

0 commit comments

Comments
 (0)