Skip to content

Commit f61ef43

Browse files
committed
feat(material/expansion): add border design tokens
Adds `expansion-container-outline-width` and `expansion-container-outline-color` tokens to both M2 and M3 themes, wired to CSS `border` properties on `.mat-expansion-panel`. Defaults are `0` and `transparent` respectively, preserving existing visual behavior. close #32878 Signed-off-by: Ruslan Lekhman <lekhman112@gmail.com>
1 parent 046e1a2 commit f61ef43

3 files changed

Lines changed: 7 additions & 0 deletions

File tree

src/material/expansion/_m2-expansion.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@
1111
@return (
1212
base: (
1313
expansion-container-shape: 4px,
14+
expansion-container-outline-width: 0,
1415
expansion-container-elevation-shadow: elevation.get-box-shadow(2),
1516
expansion-legacy-header-indicator-display: inline-block,
1617
expansion-header-indicator-display: none,
1718
),
1819
color: (
1920
expansion-container-background-color: map.get($system, surface),
21+
expansion-container-outline-color: transparent,
2022
expansion-container-text-color: map.get($system, on-surface),
2123
expansion-actions-divider-color: map.get($system, outline),
2224
expansion-header-hover-state-layer-color: m3-utils.color-with-opacity(

src/material/expansion/_m3-expansion.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@ $prefix: (mat, expansion);
1515
@return (
1616
base: (
1717
expansion-container-shape: 12px,
18+
expansion-container-outline-width: 0,
1819
expansion-header-indicator-display: inline-block,
1920
expansion-legacy-header-indicator-display: none,
2021
expansion-container-elevation-shadow: elevation.get-box-shadow(2),
2122
),
2223
color: (
2324
expansion-actions-divider-color: map.get($system, outline),
2425
expansion-container-background-color: map.get($system, surface),
26+
expansion-container-outline-color: transparent,
2527
expansion-container-text-color: map.get($system, on-surface),
2628
expansion-header-description-color: map.get($system, on-surface-variant),
2729
expansion-header-disabled-state-text-color:

src/material/expansion/expansion-panel.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ $fallbacks: m3-expansion.get-tokens();
2525
background: token-utils.slot(expansion-container-background-color, $fallbacks);
2626
color: token-utils.slot(expansion-container-text-color, $fallbacks);
2727
border-radius: token-utils.slot(expansion-container-shape, $fallbacks);
28+
border-width: token-utils.slot(expansion-container-outline-width, $fallbacks);
29+
border-color: token-utils.slot(expansion-container-outline-color, $fallbacks);
30+
border-style: solid;
2831

2932
&:not([class*='#{elevation.$prefix}']) {
3033
box-shadow: token-utils.slot(expansion-container-elevation-shadow, $fallbacks);

0 commit comments

Comments
 (0)