Skip to content

Commit 0caeb5a

Browse files
committed
fix(checkbox): incorrect text color when placed inside an overlay with a dark theme
This is along the same lines as angular#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 695dde6 commit 0caeb5a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/material/checkbox/_checkbox-theme.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@
2929
fill: $checkbox-mark-color;
3030
}
3131

32+
.mat-checkbox-label {
33+
// Explicitly set the text color since the checkbox may be
34+
// inside an overlay that doesn't have the proper theme text color.
35+
color: mat-color($foreground, 'text');
36+
}
37+
3238
.mat-checkbox-checkmark-path {
3339
// !important is needed here because a stroke must be set as an
3440
// attribute on the SVG in order for line animation to work properly.

0 commit comments

Comments
 (0)