Skip to content

Commit 97702c9

Browse files
committed
fix(material/list): use transparent background for M3
1 parent 47819c4 commit 97702c9

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/material-experimental/theming/_m3-tokens.scss

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,17 @@
451451
));
452452
}
453453

454+
/// Fixes values in the list tokens that are inconsistent with its usage.
455+
/// @param {Map} $initial-tokens Map of list tokens currently being generated.
456+
/// @return {Map} The given tokens, with the inconsistent values replaced with valid ones.
457+
@function _fix-list-tokens($tokens) {
458+
// This does not match the spec, which defines this to be `md.sys.color.surface`.
459+
// However, this interferes with the use case of placing a list on other components. For example,
460+
// the bottom sheet's container color is `md.sys.color.surface-container-low`. Instead, allow the
461+
// list to just inherit the colors for its background (and also its text).
462+
@return map.set($tokens, list-item-container-color, transparent);
463+
}
464+
454465
/// Generates a set of namespaced tokens for all components.
455466
/// @param {Map} $systems The MDC system tokens
456467
/// @param {Boolean} $include-non-systemized Whether to include non-systemized tokens
@@ -618,7 +629,9 @@
618629
),
619630
_namespace-tokens(
620631
(mdc, list),
621-
mdc-tokens.md-comp-list-values($systems, $exclude-hardcoded),
632+
_fix-list-tokens(
633+
mdc-tokens.md-comp-list-values($systems, $exclude-hardcoded)
634+
),
622635
$token-slots
623636
),
624637
_namespace-tokens(

0 commit comments

Comments
 (0)