File tree Expand file tree Collapse file tree 4 files changed +17
-7
lines changed Expand file tree Collapse file tree 4 files changed +17
-7
lines changed Original file line number Diff line number Diff line change 25
25
26
26
// :focus is applied to the input, but we apply mat-focused to the other elements
27
27
// that need to listen to it.
28
- & .mat-focused {
28
+ .mat-focused & {
29
29
color : $input-floating-placeholder-color ;
30
30
31
31
& .mat-accent {
43
43
44
44
// See mat-input-placeholder-floating mixin in input.scss
45
45
input .mat-input-element :-webkit-autofill + .mat-input-placeholder ,
46
- .mat-input-placeholder.mat-float.mat-focused {
46
+ .mat-focused .mat- input-placeholder.mat-float {
47
47
.mat-placeholder-required {
48
48
color : $input-required-placeholder-color ;
49
49
}
63
63
}
64
64
}
65
65
}
66
+
67
+ .mat-input-container.ng-invalid.ng-touched :not (.mat-focused ) {
68
+ .mat-input-placeholder ,
69
+ .mat-placeholder-required {
70
+ color : $input-underline-color-warn ;
71
+ }
72
+
73
+ .mat-input-underline {
74
+ border-color : $input-underline-color-warn ;
75
+ }
76
+ }
66
77
}
Original file line number Diff line number Diff line change 12
12
< label class ="mat-input-placeholder "
13
13
[attr.for] ="_mdInputChild.id "
14
14
[class.mat-empty] ="_mdInputChild.empty && !_shouldAlwaysFloat "
15
- [class.mat-focused] ="_mdInputChild.focused "
16
15
[class.mat-float] ="_canPlaceholderFloat "
17
16
[class.mat-accent] ="dividerColor == 'accent' "
18
17
[class.mat-warn] ="dividerColor == 'warn' "
33
32
< div class ="mat-input-underline "
34
33
[class.mat-disabled] ="_mdInputChild.disabled ">
35
34
< span class ="mat-input-ripple "
36
- [class.mat-focused] ="_mdInputChild.focused "
37
35
[class.mat-accent] ="dividerColor == 'accent' "
38
36
[class.mat-warn] ="dividerColor == 'warn' "> </ span >
39
37
</ div >
Original file line number Diff line number Diff line change @@ -149,7 +149,7 @@ $mat-input-underline-disabled-background-image:
149
149
}
150
150
151
151
// Show the placeholder above the input when it's not empty, or focused.
152
- & .mat-float :not (.mat-empty ), & .mat-float .mat-focused {
152
+ & .mat-float :not (.mat-empty ), .mat-focused & .mat-float {
153
153
@include mat-input-placeholder-floating ;
154
154
}
155
155
@@ -207,7 +207,7 @@ $mat-input-underline-disabled-background-image:
207
207
transition : transform $swift-ease-out-duration $swift-ease-out-timing-function ,
208
208
opacity $swift-ease-out-duration $swift-ease-out-timing-function ;
209
209
210
- & .mat-focused {
210
+ .mat-focused & {
211
211
opacity : 1 ;
212
212
transform : scaleY (1 );
213
213
}
Original file line number Diff line number Diff line change @@ -235,9 +235,10 @@ export class MdInputDirective {
235
235
templateUrl : 'input-container.html' ,
236
236
styleUrls : [ 'input-container.css' ] ,
237
237
host : {
238
- '[class.mat-input-container]' : 'true' ,
239
238
// Remove align attribute to prevent it from interfering with layout.
240
239
'[attr.align]' : 'null' ,
240
+ '[class.mat-input-container]' : 'true' ,
241
+ '[class.mat-focused]' : '_mdInputChild.focused' ,
241
242
'[class.ng-untouched]' : '_shouldForward("untouched")' ,
242
243
'[class.ng-touched]' : '_shouldForward("touched")' ,
243
244
'[class.ng-pristine]' : '_shouldForward("pristine")' ,
You can’t perform that action at this time.
0 commit comments