File tree Expand file tree Collapse file tree 3 files changed +33
-11
lines changed Expand file tree Collapse file tree 3 files changed +33
-11
lines changed Original file line number Diff line number Diff line change @@ -140,6 +140,20 @@ <h4>Textarea</h4>
140
140
< md-input-container color ="warn ">
141
141
< textarea mdInput placeholder ="Warn Color "> example</ textarea >
142
142
</ md-input-container >
143
+
144
+ < h4 > With error</ h4 >
145
+ < md-input-container color ="primary " >
146
+ < input mdInput placeholder ="Default Color " [(ngModel)] ="dividerColorExample1 " required >
147
+ < md-error > This field is required</ md-error >
148
+ </ md-input-container >
149
+ < md-input-container color ="accent ">
150
+ < input mdInput placeholder ="Accent Color " [(ngModel)] ="dividerColorExample2 " required >
151
+ < md-error > This field is required</ md-error >
152
+ </ md-input-container >
153
+ < md-input-container color ="warn ">
154
+ < input mdInput placeholder ="Warn Color " [(ngModel)] ="dividerColorExample3 " required >
155
+ < md-error > This field is required</ md-error >
156
+ </ md-input-container >
143
157
</ md-card-content >
144
158
</ md-card >
145
159
Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ export class InputDemo {
23
23
errorMessageExample1 : string ;
24
24
errorMessageExample2 : string ;
25
25
errorMessageExample3 : string ;
26
+ dividerColorExample1 : string ;
27
+ dividerColorExample2 : string ;
28
+ dividerColorExample3 : string ;
26
29
items : any [ ] = [
27
30
{ value : 10 } ,
28
31
{ value : 20 } ,
Original file line number Diff line number Diff line change 42
42
color : mat-color ($foreground , disabled-text );
43
43
}
44
44
45
- // See mat-input-placeholder-floating mixin in input.scss
45
+ // See mat-input-placeholder-floating mixin in input-container .scss
46
46
input .mat-input-element :-webkit-autofill + .mat-input-placeholder ,
47
47
.mat-focused .mat-input-placeholder.mat-float {
48
48
.mat-placeholder-required {
52
52
53
53
.mat-input-underline {
54
54
border-color : $input-underline-color ;
55
+ }
55
56
56
- .mat-input-ripple {
57
- background-color : $input-underline-focused-color ;
57
+ .mat-input-ripple {
58
+ background-color : $input-underline-focused-color ;
58
59
59
- & .mat-accent {
60
- background-color : $input-underline-color-accent ;
61
- }
62
- & .mat-warn {
63
- background-color : $input-underline-color- warn;
64
- }
60
+ & .mat-accent {
61
+ background-color : $input-underline-color-accent ;
62
+ }
63
+
64
+ & .mat- warn {
65
+ background-color : $input-underline-color-warn ;
65
66
}
66
67
}
67
68
68
69
// Styling for the error state of the input container. Note that while the same can be
69
70
// achieved with the ng-* classes, we use this approach in order to ensure that the same
70
71
// logic is used to style the error state and to show the error messages.
71
72
.mat-input-invalid {
72
- .mat-input-placeholder ,
73
- .mat-placeholder-required {
73
+ .mat-input-placeholder {
74
74
color : $input-underline-color-warn ;
75
+
76
+ & .mat-accent ,
77
+ & .mat-float .mat-placeholder-required {
78
+ color : $input-underline-color-warn ;
79
+ }
75
80
}
76
81
77
82
.mat-input-ripple {
You can’t perform that action at this time.
0 commit comments