File tree Expand file tree Collapse file tree 3 files changed +36
-6
lines changed Expand file tree Collapse file tree 3 files changed +36
-6
lines changed Original file line number Diff line number Diff line change 22
22
* Applies styles for users in high contrast mode. Note that this only applies
23
23
* to Microsoft browsers. Chrome can be included by checking for the `html[hc]`
24
24
* attribute, however Chrome handles high contrast differently.
25
+ * @param target Which kind of high contrast setting to target. Defaults to `active`, can be
26
+ * `white-on-black` or `black-on-white`.
25
27
*/
26
- @mixin cdk-high-contrast {
27
- @media screen and (-ms-high-contrast : active ) {
28
+ @mixin cdk-high-contrast ( $target : active ) {
29
+ @media screen and (-ms-high-contrast : $target ) {
28
30
@content ;
29
31
}
30
32
}
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' ;
3
4
4
5
5
6
@mixin mat-checkbox-theme ($theme ) {
29
30
}
30
31
31
32
.mat-checkbox-checkmark-path {
32
- // !important is needed here because a stroke must be set as an attribute on the SVG in order
33
- // for line animation to work properly.
33
+ // !important is needed here because a stroke must be set as an
34
+ // attribute on the SVG in order for line animation to work properly.
34
35
stroke : $checkbox-mark-color !important ;
36
+
37
+ @include cdk-high-contrast (black- on- white) {
38
+ // Having the one above be !important ends up overriding the browser's automatic
39
+ // color inversion so we need to re-invert it ourselves for black-on-white.
40
+ stroke : #000 !important ;
41
+ }
35
42
}
36
43
37
44
.mat-checkbox-mixedmark {
68
75
.mat-checkbox-label {
69
76
color : $disabled-color ;
70
77
}
78
+
79
+ @include cdk-high-contrast {
80
+ opacity : 0.5 ;
81
+ }
82
+ }
83
+
84
+ // This one is moved down here so it can target both
85
+ // the theme colors and the disabled state.
86
+ @include cdk-high-contrast {
87
+ .mat-checkbox-background {
88
+ // Needs to be removed because it hides the checkbox outline.
89
+ background : none ;
90
+ }
71
91
}
72
92
73
93
.mat-checkbox :not (.mat-checkbox-disabled ) {
Original file line number Diff line number Diff line change 4
4
@import ' ../core/ripple/ripple' ;
5
5
@import ' ../core/style/layout-common' ;
6
6
@import ' ../core/style/noop-animation' ;
7
+ @import ' ../../cdk/a11y/a11y' ;
7
8
8
9
// Manual calculation done on SVG
9
10
$_mat-checkbox-mark-path-length : 22.910259 ;
@@ -275,11 +276,18 @@ $_mat-checkbox-mark-stroke-size: 2 / 15 * $mat-checkbox-size !default;
275
276
}
276
277
277
278
.mat-checkbox-mixedmark {
278
- @extend %mat -checkbox-mark ;
279
+ $height : floor ( $_mat -checkbox-mark-stroke-size ) ;
279
280
280
- height : floor ($_mat-checkbox-mark-stroke-size );
281
+ @extend %mat-checkbox-mark ;
282
+ height : $height ;
281
283
opacity : 0 ;
282
284
transform : scaleX (0 ) rotate (0deg );
285
+
286
+ @include cdk-high-contrast {
287
+ height : 0 ;
288
+ border-top : solid $height ;
289
+ margin-top : $height ;
290
+ }
283
291
}
284
292
285
293
.mat-checkbox-label-before {
You can’t perform that action at this time.
0 commit comments