Skip to content

Commit

Permalink
fix(material/checkbox): incorrect text color when placed inside an ov…
Browse files Browse the repository at this point in the history
…erlay with a dark theme (angular#19054)

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.
  • Loading branch information
crisbeto authored Mar 2, 2022
1 parent f05e65a commit f20122a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/material/checkbox/_checkbox-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@
fill: $checkbox-mark-color;
}

.mat-checkbox-label {
// Explicitly set the text color since the checkbox may be
// inside an overlay that doesn't have the proper theme text color.
color: theming.get-color-from-palette($foreground, 'text');
}

.mat-checkbox-checkmark-path {
// !important is needed here because a stroke must be set as an
// attribute on the SVG in order for line animation to work properly.
Expand Down

0 comments on commit f20122a

Please sign in to comment.