File tree Expand file tree Collapse file tree 2 files changed +19
-20
lines changed Expand file tree Collapse file tree 2 files changed +19
-20
lines changed Original file line number Diff line number Diff line change 1
1
@import ' ../core/theming/theming' ;
2
2
@import ' ../core/typography/typography-utils' ;
3
- @import ' ../../cdk/a11y/a11y' ;
4
3
5
4
6
5
@mixin mat-checkbox-theme ($theme ) {
34
33
// !important is needed here because a stroke must be set as an
35
34
// attribute on the SVG in order for line animation to work properly.
36
35
stroke : $checkbox-mark-color !important ;
37
-
38
- @include cdk-high-contrast (black- on- white) {
39
- // Having the one above be !important ends up overriding the browser's automatic
40
- // color inversion so we need to re-invert it ourselves for black-on-white.
41
- stroke : #000 !important ;
42
- }
43
36
}
44
37
45
38
.mat-checkbox-mixedmark {
77
70
.mat-checkbox-label {
78
71
color : mat-color ($foreground , secondary-text );
79
72
}
80
-
81
- @include cdk-high-contrast {
82
- opacity : 0.5 ;
83
- }
84
- }
85
-
86
- // This one is moved down here so it can target both
87
- // the theme colors and the disabled state.
88
- @include cdk-high-contrast {
89
- .mat-checkbox-background {
90
- // Needs to be removed because it hides the checkbox outline.
91
- background : none ;
92
- }
93
73
}
94
74
95
75
// Switch this to a solid color since we're using `opacity`
Original file line number Diff line number Diff line change @@ -275,6 +275,15 @@ $_mat-checkbox-mark-stroke-size: 2 / 15 * $mat-checkbox-size !default;
275
275
._mat-animation-noopable & {
276
276
transition : none ;
277
277
}
278
+
279
+ // `.mat-checkbox` here is redundant, but we need it to increase the specificity so that
280
+ // these styles don't get overwritten by the `background-color` from the theme.
281
+ .mat-checkbox & {
282
+ @include cdk-high-contrast {
283
+ // Needs to be removed because it hides the checkbox outline.
284
+ background : none ;
285
+ }
286
+ }
278
287
}
279
288
280
289
.mat-checkbox-persistent-ripple {
@@ -319,6 +328,12 @@ $_mat-checkbox-mark-stroke-size: 2 / 15 * $mat-checkbox-size !default;
319
328
dasharray : $_mat-checkbox-mark-path-length ;
320
329
width : $_mat-checkbox-mark-stroke-size ;
321
330
}
331
+
332
+ @include cdk-high-contrast (black- on- white) {
333
+ // In the checkbox theme this `stroke` has !important which ends up overriding the browser's
334
+ // automatic color inversion so we need to re-invert it ourselves for black-on-white.
335
+ stroke : #000 !important ;
336
+ }
322
337
}
323
338
324
339
.mat-checkbox-mixedmark {
@@ -393,6 +408,10 @@ $_mat-checkbox-mark-stroke-size: 2 / 15 * $mat-checkbox-size !default;
393
408
394
409
.mat-checkbox-disabled {
395
410
cursor : default ;
411
+
412
+ @include cdk-high-contrast {
413
+ opacity : 0.5 ;
414
+ }
396
415
}
397
416
398
417
.mat-checkbox-anim {
You can’t perform that action at this time.
0 commit comments