Skip to content

Commit 1ac7b08

Browse files
committed
fix(material/list): use transparent background for M3
1 parent 25a6b78 commit 1ac7b08

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
@@ -464,6 +464,17 @@
464464
@return $tokens;
465465
}
466466

467+
/// Fixes values in the list tokens that are inconsistent with its usage.
468+
/// @param {Map} $initial-tokens Map of list tokens currently being generated.
469+
/// @return {Map} The given tokens, with the inconsistent values replaced with valid ones.
470+
@function _fix-list-tokens($tokens) {
471+
// This does not match the spec, which defines this to be `md.sys.color.surface`.
472+
// However, this interferes with the use case of placing a list on other components. For example,
473+
// the bottom sheet's container color is `md.sys.color.surface-container-low`. Instead, allow the
474+
// list to just inherit the colors for its background (and also its text).
475+
@return map.set($tokens, list-item-container-color, transparent);
476+
}
477+
467478
/// Generates a set of namespaced tokens for all components.
468479
/// @param {Map} $systems The MDC system tokens
469480
/// @param {Boolean} $include-non-systemized Whether to include non-systemized tokens
@@ -660,7 +671,9 @@
660671
),
661672
_namespace-tokens(
662673
(mdc, list),
663-
mdc-tokens.md-comp-list-values($systems, $exclude-hardcoded),
674+
_fix-list-tokens(
675+
mdc-tokens.md-comp-list-values($systems, $exclude-hardcoded)
676+
),
664677
$token-slots
665678
),
666679
_namespace-tokens(

0 commit comments

Comments
 (0)