Skip to content
This repository was archived by the owner on Jan 13, 2025. It is now read-only.

Commit 39f95a3

Browse files
committed
fix(select): Add missing mixin (#3435)
Add missing `mdc-select-corner-radius` mixin for styling the corners of the `--box` variant. (cherry picked from commit e654526)
1 parent 33a6d3f commit 39f95a3

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

packages/mdc-select/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ Mixin | Description
215215
`mdc-select-focused-label-color($color)` | Customizes the label color of the select when focused.
216216
`mdc-select-bottom-line-color($color)` | Customizes the color of the default bottom line of the select.
217217
`mdc-select-focused-bottom-line-color($color)` | Customizes the color of the bottom line of the select when focused.
218+
`mdc-select-corner-radius($radius)` | Customizes the corner radius of the box variant of the select.
218219
`mdc-select-hover-bottom-line-color($color)` | Customizes the color of the bottom line when the select is hovered.
219220
`mdc-select-outline-color($color)` | Customizes the color of the notched outline.
220221
`mdc-select-outline-corner-radius($radius)` | Sets the border radius of of the outlined select variant.

packages/mdc-select/_mixins.scss

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,24 @@
8989
}
9090
}
9191

92+
@mixin mdc-select-corner-radius($radius) {
93+
border-radius: $radius $radius 0 0;
94+
}
95+
96+
@mixin mdc-select-outline-corner-radius($radius) {
97+
// NOTE: idle and notched state border radius mixins
98+
// are broken into 2 different mixins, otherwise
99+
// we would be overly specific (big no, no). The cause of
100+
// this is because .mdc-notched-outline and .mdc-notched-outline__idle
101+
// are siblings. .mdc-notched-outline__idle needs to be a child of
102+
// .mdc-notched-outline in order to remedy this issue.
103+
.mdc-notched-outline {
104+
@include mdc-notched-outline-corner-radius($radius);
105+
}
106+
107+
@include mdc-notched-outline-idle-corner-radius($radius);
108+
}
109+
92110
// Private
93111
@mixin mdc-select-focused-line-ripple_ {
94112
.mdc-select__native-control:focus ~ .mdc-line-ripple {
@@ -133,20 +151,6 @@
133151
background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2210px%22%20height%3D%225px%22%20viewBox%3D%227%2010%2010%205%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%0A%20%20%20%20%3Cpolygon%20id%3D%22Shape%22%20stroke%3D%22none%22%20fill%3D%22%23#{$fill-hex-number}%22%20fill-rule%3D%22evenodd%22%20opacity%3D%22#{$opacity}%22%20points%3D%227%2010%2012%2015%2017%2010%22%3E%3C%2Fpolygon%3E%0A%3C%2Fsvg%3E");
134152
}
135153

136-
@mixin mdc-select-outline-corner-radius($radius) {
137-
// NOTE: idle and notched state border radius mixins
138-
// are broken into 2 different mixins, otherwise
139-
// we would be overly specific (big no, no). The cause of
140-
// this is because .mdc-notched-outline and .mdc-notched-outline__idle
141-
// are siblings. .mdc-notched-outline__idle needs to be a child of
142-
// .mdc-notched-outline in order to remedy this issue.
143-
.mdc-notched-outline {
144-
@include mdc-notched-outline-corner-radius($radius);
145-
}
146-
147-
@include mdc-notched-outline-idle-corner-radius($radius);
148-
}
149-
150154
@mixin mdc-select-outline-color_($color) {
151155
// NOTE: outlined version of select wants the "idle" and
152156
// "notched" outline to have the same color. This covers two cases:

0 commit comments

Comments
 (0)