Skip to content

Commit df58663

Browse files
authored
feat(material/select): add a styling token for the panel shape (#34119)
Previously the border radius of the select panel was hardcoded to 4px and couldn't be changed through tokens. Adds a `container-shape` token to `select-overrides`, matching the existing token of the autocomplete and menu panels. The default stays 4px. In M3 the value comes from `corner-extra-small`, so the panel now follows that system token like the other two panels. Co-authored-by: Laxminarayan Chandrashekar <5959880+lxminarayn@users.noreply.github.com>
1 parent dbd4e06 commit df58663

3 files changed

Lines changed: 3 additions & 1 deletion

File tree

‎src/material/select/_m2-select.scss‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
@return (
1212
base: (
1313
select-container-elevation-shadow: elevation.get-box-shadow(8),
14+
select-container-shape: 4px,
1415
),
1516
color: private-get-color-palette-color-tokens($theme, primary),
1617
typography: (

‎src/material/select/_m3-select.scss‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ $prefix: (mat, select);
1919
@return (
2020
base: (
2121
select-container-elevation-shadow: elevation.get-box-shadow(2),
22+
select-container-shape: map.get($system, corner-extra-small),
2223
),
2324
color: (
2425
select-panel-background-color: map.get($system, surface-container),

‎src/material/select/select.scss‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ div.mat-mdc-select-panel {
151151
// DOM for the Gmat versions to work. We need to bump up the specificity here
152152
// so that it's higher than MDC's styles.
153153
div.mat-mdc-select-panel {
154-
$border-radius: 4px;
154+
$border-radius: token-utils.slot(select-container-shape, $fallbacks, 4px);
155155
width: 100%; // Ensures that the panel matches the overlay width.
156156
max-height: $mat-select-panel-max-height;
157157
outline: 0;

0 commit comments

Comments
 (0)