This repository was archived by the owner on Jan 13, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -554,6 +554,7 @@ Mixin | Description
554554` filled-with-leading-icon-height($height) ` | Sets height of filled select with leading icon variant.
555555` outlined-height($height) ` | Sets height of outlined select variant (Excluding outlined select with leading icon).
556556` outlined-with-leading-icon-height($height) ` | Sets height of outlined select with leading icon variant.
557+ ` variable-width($min-width) ` | Sets the select behavior to change width dynamically based on content.
557558
558559> _ NOTE_ : To further customize the floating label, please see the [ floating label documentation] ( ./../mdc-floating-label/README.md ) .
559560
Original file line number Diff line number Diff line change @@ -165,6 +165,20 @@ $error-color: error !default;
165165 }
166166}
167167
168+ /// Sets the select behavior to change width dynamically based on content.
169+ /// @param {Number} $min-width - The min-width of the select, which should be
170+ /// large enough to allow the label (if exists) to display in full.
171+ @mixin variable-width ($min-width , $query : feature-targeting .all ()) {
172+ $feat-structure : feature-targeting .create-target ($query , structure );
173+
174+ .mdc-select__anchor {
175+ @include feature-targeting .targets ($feat-structure ) {
176+ width : 100% ;
177+ min-width : $min-width ;
178+ }
179+ }
180+ }
181+
168182@mixin ink-color ($color-or-map , $query : feature-targeting .all ()) {
169183 @include _if-enabled {
170184 @include _ink-color (state .get-default-state ($color-or-map ), $query : $query );
You can’t perform that action at this time.
0 commit comments