@@ -6,9 +6,23 @@ $select-option-height: 48px !default;
66$select-option-padding : 16px !default ;
77$select-container-padding : 16px !default ;
88$select-container-transition-duration : 350ms !default ;
9+ $select-value-padding-top : 6px ;
10+ $select-value-padding-bottom : 4px ;
911
1012$select-max-visible-options : 5 !default ;
1113
14+ // from input.scss
15+ $input-container-margin-top : 18px !default ;
16+ $input-container-padding-top : 2px !default ;
17+ $input-padding-top : 2px !default ;
18+ $input-padding-bottom : 1px !default ;
19+
20+ $input-alignment : ($input-padding-top + $input-padding-bottom )
21+ - ($select-value-padding-top + $select-value-padding-bottom );
22+ $md-inline-alignment : ($input-container-margin-top + $input-container-padding-top )
23+ + ($input-padding-top + $input-padding-bottom )
24+ - ($select-value-padding-top + $select-value-padding-bottom );
25+
1226// Fixes the animations with the floating label when select is inside an input container
1327md-input-container {
1428 & :not ([md-no-float ]) {
@@ -20,7 +34,7 @@ md-input-container {
2034 & .md-input-focused {
2135 & :not ([md-no-float ]) {
2236 .md-select-placeholder span :first-child {
23- transform : translateY ( -22 px ) translateX ( -2 px ) scale (0.75 );
37+ transform : translate ( -2 px , -22 px ) scale (0.75 );
2438 }
2539 }
2640 }
@@ -47,7 +61,6 @@ md-input-container {
4761 margin : 3 * $baseline-grid auto !important ;
4862 }
4963
50-
5164 // enter: md-select scales in, then options fade in.
5265 & .md-active {
5366 display : block ;
@@ -72,11 +85,19 @@ md-input-container {
7285 }
7386}
7487
75- md-input-container > md-select {
76- margin : 0 ;
77- order : 2 ;
88+ .md-inline-form md-select {
89+ margin-top : $md-inline-alignment ;
7890}
7991
92+ md-input-container {
93+ > md-select ,
94+ .md-inline-form & > md-select {
95+ margin-top : $input-alignment ;
96+ }
97+ > md-select {
98+ order : 2 ;
99+ }
100+ }
80101
81102// Show the asterisk on the placeholder if the element is required
82103//
@@ -103,7 +124,6 @@ md-input-container.md-input-invalid {
103124
104125md-select {
105126 display : flex ;
106- margin : 2.5 * $baseline-grid 0 3 * $baseline-grid + 2 0 ;
107127
108128 & [required ], & .ng-required {
109129 & .ng-empty.ng-invalid :not (.md-no-asterisk ) {
@@ -124,6 +144,12 @@ md-select {
124144 // to create a dotted line under the input.
125145 background-size : 4px 1px ;
126146 background-repeat : repeat-x ;
147+ // Add to padding-bottom to keep dotted line aligned with other bottom borders
148+ // Sub from padding-top to keep height consistent
149+ // Translate text 1px up to keep in alignment
150+ padding-bottom : $select-value-padding-bottom + 1 ;
151+ padding-top : $select-value-padding-top - 1 ;
152+ transform : translateY (1px );
127153 }
128154
129155 & :focus {
@@ -138,20 +164,14 @@ md-select {
138164 }
139165 & .ng-invalid.ng-touched {
140166 .md-select-value {
141- border-bottom-style : solid ;
142- padding-bottom : 1px ;
167+ border-bottom : 2px solid ;
143168 }
144169 }
145170 & :focus {
146171 .md-select-value {
147172 border-bottom-width : $select-border-width-default + 1px ;
148173 border-bottom-style : solid ;
149- padding-bottom : 0 ;
150- }
151- & .ng-invalid.ng-touched {
152- .md-select-value {
153- padding-bottom : 0 ;
154- }
174+ padding-bottom : $select-value-padding-bottom - 1 ;
155175 }
156176 }
157177 }
@@ -187,17 +207,19 @@ md-input-container md-select {
187207.md-select-value {
188208 display : flex ;
189209 align-items : center ;
190- padding-top : 2 px ;
191- padding-bottom : 1 px ;
210+ padding-top : $select-value-padding-top ;
211+ padding-bottom : $select-value-padding-bottom ;
192212 @include rtl (padding-left , 0 , $input-container-padding );
193213 @include rtl (padding-right , $input-container-padding , 0 );
194214 border-bottom-width : $select-border-width-default ;
195215 border-bottom-style : solid ;
196216 background-color : rgba (0 ,0 ,0 ,0 );
197217 position : relative ;
198218 box-sizing : content-box ;
199- min-width : 8 * $baseline-grid ;
219+ min-width : 11 * $baseline-grid ;
200220 min-height : 26px ;
221+ margin-bottom : auto ;
222+ -ms-flex-item-align : start ; // workaround for margin-bottom: auto
201223 flex-grow : 1 ;
202224
203225 > span :not (.md-select-icon ) {
@@ -217,8 +239,7 @@ md-input-container md-select {
217239 @include rtl (align-items , flex-end , flex-start );
218240 @include rtl (text-align , right , left );
219241 width : 3 * $baseline-grid ;
220- margin : 0 .5 * $baseline-grid ;
221- transform : translate3d (0 , -2px , 0 );
242+ transform : translateY (-2px );
222243 font-size : 1.2rem ;
223244 }
224245
@@ -227,9 +248,11 @@ md-input-container md-select {
227248 content : ' \25BC ' ;
228249 position : relative ;
229250 top : 2px ;
251+ @include rtl (right , -4px , auto );
252+ @include rtl (left , auto , -4px );
230253 speak : none ;
231- font-size : 13 px ;
232- transform : scaleY (0.5 ) scaleX ( 1 ) ;
254+ font-size : 16 px ;
255+ transform : scaleY (0.5 );
233256 }
234257
235258 & .md-select-placeholder {
0 commit comments