Skip to content

Commit 9b3992b

Browse files
authored
fix(material-experimental/mdc-checkbox): fix dark theme (#20926)
1 parent 40b602f commit 9b3992b

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

src/material-experimental/mdc-checkbox/_checkbox-theme.scss

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use '@material/checkbox/checkbox-theme' as checkbox-theme;
2+
13
@import '@material/checkbox/mixins.import';
24
@import '@material/checkbox/variables.import';
35
@import '@material/form-field/mixins.import';
@@ -8,15 +10,19 @@
810
// Mixin that includes the checkbox theme styles with a given palette.
911
// By default, the MDC checkbox always uses the `secondary` palette.
1012
@mixin _mdc-checkbox-styles-with-color($color) {
11-
$orig-mdc-checkbox-mark-color: $mdc-checkbox-mark-color;
12-
$mdc-checkbox-mark-color: mdc-theme-prop-value(on-#{$color}) !global;
13-
$orig-mdc-checkbox-baseline-theme-color: $mdc-checkbox-baseline-theme-color;
14-
$mdc-checkbox-baseline-theme-color: $color !global;
15-
16-
@include mdc-checkbox-without-ripple($query: $mat-theme-styles-query);
17-
18-
$mdc-checkbox-mark-color: $orig-mdc-checkbox-mark-color !global;
19-
$mdc-checkbox-baseline-theme-color: $orig-mdc-checkbox-baseline-theme-color !global;
13+
@include checkbox-theme.theme((
14+
density-scale: null,
15+
checkmark-color: mdc-theme-prop-value(on-#{$color}),
16+
container-checked-color: $color,
17+
container-checked-hover-color: null,
18+
container-disabled-color: rgba(mdc-theme-prop-value(on-surface), 0.38),
19+
outline-color: rgba(mdc-theme-prop-value(on-surface), 0.54),
20+
outline-hover-color: null,
21+
ripple-color: null,
22+
ripple-opacity: null,
23+
ripple-checked-color: null,
24+
ripple-checked-opacity: null,
25+
));
2026
}
2127

2228
@mixin mat-mdc-checkbox-color($config-or-theme) {

0 commit comments

Comments
 (0)