File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
src/material-experimental/mdc-select Expand file tree Collapse file tree 1 file changed +26
-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,27 @@ $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 {
126
+ & .mat-form-field-appearance-fill {
127
+ .mdc-floating-label {
128
+ max-width : calc (100% - #{$mat-select-placeholder-arrow-space } );
129
+ }
130
+
131
+ .mdc-floating-label--float-above {
132
+ max-width : calc (100% / #{$scale } - #{$mat-select-placeholder-arrow-space / $scale } );
133
+ }
134
+ }
135
+ & .mat-form-field-appearance-outline {
136
+ .mdc-notched-outline__notch {
137
+ max-width : calc (100% - #{2 * ($mat-select-placeholder-arrow-space + $leading-width )} );
138
+ }
139
+
140
+ .mdc-text-field--label-floating .mdc-notched-outline__notch {
141
+ max-width : calc (100% - #{$leading-width * 2 } );
142
+ }
143
+ }
144
+ }
You can’t perform that action at this time.
0 commit comments