File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
src/material-experimental/mdc-select Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ $mat-select-arrow-size: 5px !default;
8
8
$mat-select-arrow-margin : 4px !default ;
9
9
$mat-select-panel-max-height : 256px !default ;
10
10
$mat-select-placeholder-arrow-space : 2 * ($mat-select-arrow-size + $mat-select-arrow-margin );
11
+ $leading-width : 12px !default ;
12
+ $scale : 0.75 !default ;
11
13
12
14
// We base the select panel styling on top of MDC's menu styles and we
13
15
// implement the trigger ourselves since MDC doesn't provide an equivalent.
@@ -116,3 +118,25 @@ $mat-select-placeholder-arrow-space: 2 * ($mat-select-arrow-size + $mat-select-a
116
118
display : block ;
117
119
}
118
120
}
121
+
122
+ // Our MDC form field implementation is based on the MDC text field which doesn't include styles
123
+ // for select. The select specific styles are not present as they don't use their text field as a
124
+ // container. Below are the styles to account for the select arrow icon at the end.
125
+ .mat-mdc-form-field-type-mat-select.mat-form-field-appearance-fill {
126
+ .mdc-floating-label {
127
+ max-width : calc (100% - #{$mat-select-placeholder-arrow-space } );
128
+ }
129
+ .mdc-floating-label--float-above {
130
+ max-width : calc (100% / #{$scale } - #{$mat-select-placeholder-arrow-space } / #{$scale } );
131
+ }
132
+ }
133
+
134
+ .mat-mdc-form-field-type-mat-select.mat-form-field-appearance-outline {
135
+ .mdc-notched-outline__notch {
136
+ max-width : calc (100% - 2 * (#{$mat-select-placeholder-arrow-space } + #{$leading-width } ));
137
+ }
138
+
139
+ .mdc-text-field--label-floating .mdc-notched-outline__notch {
140
+ max-width : calc (100% - #{$leading-width } * 2 );
141
+ }
142
+ }
You can’t perform that action at this time.
0 commit comments