File tree Expand file tree Collapse file tree 4 files changed +45
-3
lines changed Expand file tree Collapse file tree 4 files changed +45
-3
lines changed Original file line number Diff line number Diff line change 1
1
@import ' ../core/style/variables' ;
2
2
@import ' ../core/style/vendor-prefixes' ;
3
-
3
+ @import ' ../../cdk/a11y/a11y ' ;
4
4
5
5
// Styles that only apply to the fill appearance of the form-field.
6
6
@@ -27,6 +27,10 @@ $mat-form-field-fill-subscript-padding:
27
27
border-radius : $mat-form-field-fill-border-radius $mat-form-field-fill-border-radius 0 0 ;
28
28
padding : $mat-form-field-fill-line-spacing $mat-form-field-fill-side-padding 0
29
29
$mat-form-field-fill-side-padding ;
30
+
31
+ @include cdk-high-contrast {
32
+ outline : solid 1px ;
33
+ }
30
34
}
31
35
32
36
.mat-form-field-underline ::before {
@@ -41,6 +45,11 @@ $mat-form-field-fill-subscript-padding:
41
45
.mat-form-field-ripple {
42
46
bottom : 0 ;
43
47
height : $mat-form-field-fill-underline-ripple-height ;
48
+
49
+ @include cdk-high-contrast {
50
+ height : 0 ;
51
+ border-top : solid $mat-form-field-fill-underline-ripple-height ;
52
+ }
44
53
}
45
54
46
55
// Note that we need this specific of a selector because we don't want
Original file line number Diff line number Diff line change 1
1
@import ' ../core/style/variables' ;
2
2
@import ' ../core/style/vendor-prefixes' ;
3
+ @import ' ../../cdk/a11y/a11y' ;
3
4
4
5
5
6
// Styles that only apply to the legacy appearance of the form-field.
@@ -36,11 +37,22 @@ $mat-form-field-legacy-underline-height: 1px !default;
36
37
// The ripple is the blue animation coming on top of it.
37
38
.mat-form-field-underline {
38
39
height : $mat-form-field-legacy-underline-height ;
40
+
41
+ @include cdk-high-contrast {
42
+ height : 0 ;
43
+ border-top : solid $mat-form-field-legacy-underline-height ;
44
+ }
39
45
}
40
46
41
47
.mat-form-field-ripple {
48
+ $height : $mat-form-field-legacy-underline-height * 2 ;
42
49
top : 0 ;
43
- height : $mat-form-field-legacy-underline-height * 2 ;
50
+ height : $height ;
51
+
52
+ @include cdk-high-contrast {
53
+ height : 0 ;
54
+ border-top : solid $height ;
55
+ }
44
56
}
45
57
46
58
& .mat-form-field-disabled .mat-form-field-underline {
Original file line number Diff line number Diff line change 1
1
@import ' ../core/style/variables' ;
2
2
@import ' ../core/style/vendor-prefixes' ;
3
+ @import ' ../../cdk/a11y/a11y' ;
3
4
4
5
5
6
// Styles that only apply to the standard appearance of the form-field.
@@ -20,11 +21,22 @@ $mat-form-field-standard-padding-top: 0.75em !default;
20
21
// The ripple is the blue animation coming on top of it.
21
22
.mat-form-field-underline {
22
23
height : $mat-form-field-standard-underline-height ;
24
+
25
+ @include cdk-high-contrast {
26
+ height : 0 ;
27
+ border-top : solid $mat-form-field-standard-underline-height ;
28
+ }
23
29
}
24
30
25
31
.mat-form-field-ripple {
32
+ $height : $mat-form-field-standard-underline-height * 2 ;
26
33
bottom : 0 ;
27
- height : $mat-form-field-standard-underline-height * 2 ;
34
+ height : $height ;
35
+
36
+ @include cdk-high-contrast {
37
+ height : 0 ;
38
+ border-top : $height ;
39
+ }
28
40
}
29
41
30
42
& .mat-form-field-disabled .mat-form-field-underline {
Original file line number Diff line number Diff line change 1
1
@import ' ../core/style/variables' ;
2
2
@import ' ../core/style/vendor-prefixes' ;
3
+ @import ' ../../cdk/a11y/a11y' ;
3
4
4
5
5
6
// Styles that apply to all appearances of the form-field.
@@ -52,6 +53,14 @@ $mat-form-field-default-infix-width: 180px !default;
52
53
flex : auto ;
53
54
min-width : 0 ;
54
55
width : $mat-form-field-default-infix-width ;
56
+
57
+ // In high contrast mode IE/Edge will render all of the borders, even if they're transparent.
58
+ // Since we can't remove the border altogether or replace it with a margin, because it'll throw
59
+ // off the baseline, and we can't use a base64-encoded 1x1 transparent image because of CSP,
60
+ // we work around it by setting a linear gradient that goes from `transparent` to `transparent`.
61
+ @include cdk-high-contrast {
62
+ border-image : linear-gradient (transparent , transparent );
63
+ }
55
64
}
56
65
57
66
// Used to hide the label overflow on IE, since IE doesn't take transform into account when
You can’t perform that action at this time.
0 commit comments