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 2525
2626 // :focus is applied to the input, but we apply mat-focused to the other elements
2727 // that need to listen to it.
28- & .mat-focused {
28+ .mat-focused & {
2929 color : $input-floating-placeholder-color ;
3030
3131 & .mat-accent {
4343
4444 // See mat-input-placeholder-floating mixin in input.scss
4545 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 {
4747 .mat-placeholder-required {
4848 color : $input-required-placeholder-color ;
4949 }
6363 }
6464 }
6565 }
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+ }
6677}
Original file line number Diff line number Diff line change 1212 < label class ="mat-input-placeholder "
1313 [attr.for] ="_mdInputChild.id "
1414 [class.mat-empty] ="_mdInputChild.empty && !_shouldAlwaysFloat "
15- [class.mat-focused] ="_mdInputChild.focused "
1615 [class.mat-float] ="_canPlaceholderFloat "
1716 [class.mat-accent] ="dividerColor == 'accent' "
1817 [class.mat-warn] ="dividerColor == 'warn' "
3332 < div class ="mat-input-underline "
3433 [class.mat-disabled] ="_mdInputChild.disabled ">
3534 < span class ="mat-input-ripple "
36- [class.mat-focused] ="_mdInputChild.focused "
3735 [class.mat-accent] ="dividerColor == 'accent' "
3836 [class.mat-warn] ="dividerColor == 'warn' "> </ span >
3937 </ div >
Original file line number Diff line number Diff line change @@ -149,7 +149,7 @@ $mat-input-underline-disabled-background-image:
149149 }
150150
151151 // 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 {
153153 @include mat-input-placeholder-floating ;
154154 }
155155
@@ -207,7 +207,7 @@ $mat-input-underline-disabled-background-image:
207207 transition : transform $swift-ease-out-duration $swift-ease-out-timing-function ,
208208 opacity $swift-ease-out-duration $swift-ease-out-timing-function ;
209209
210- & .mat-focused {
210+ .mat-focused & {
211211 opacity : 1 ;
212212 transform : scaleY (1 );
213213 }
Original file line number Diff line number Diff line change @@ -235,9 +235,10 @@ export class MdInputDirective {
235235 templateUrl : 'input-container.html' ,
236236 styleUrls : [ 'input-container.css' ] ,
237237 host : {
238- '[class.mat-input-container]' : 'true' ,
239238 // Remove align attribute to prevent it from interfering with layout.
240239 '[attr.align]' : 'null' ,
240+ '[class.mat-input-container]' : 'true' ,
241+ '[class.mat-focused]' : '_mdInputChild.focused' ,
241242 '[class.ng-untouched]' : '_shouldForward("untouched")' ,
242243 '[class.ng-touched]' : '_shouldForward("touched")' ,
243244 '[class.ng-pristine]' : '_shouldForward("pristine")' ,
You can’t perform that action at this time.
0 commit comments