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 (#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.

(cherry picked from commit f20122a)
  • Loading branch information
crisbeto committed Mar 2, 2022
1 parent 5a79042 commit 005ec32
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 005ec32

Please sign in to comment.