Skip to content

Commit 957bc48

Browse files
committed
fix(material-experimental/theming): align fab with M3 spec
* Fixes that we weren't emitting the height and shape tokens for the extended FAB which in turn prevented the M3 tokens from working. * Fixes that all FAB variants were using the wrong color for the state layer, causing it to blend in with the background.
1 parent a496855 commit 957bc48

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@
321321
@function fab($systems, $exclude-hardcoded) {
322322
@return ((
323323
foreground-color: map.get($systems, md-sys-color, on-primary-container),
324-
state-layer-color: map.get($systems, md-sys-color, primary-container),
324+
state-layer-color: map.get($systems, md-sys-color, on-primary-container),
325325
ripple-color: mat.private-safe-color-change(
326326
map.get($systems, md-sys-color, on-primary-container),
327327
$alpha: map.get($systems, md-sys-state, pressed-state-layer-opacity)
@@ -338,15 +338,15 @@
338338
primary: (), // Default, no overrides needed.
339339
secondary: (
340340
foreground-color: map.get($systems, md-sys-color, on-secondary-container),
341-
state-layer-color: map.get($systems, md-sys-color, secondary-container),
341+
state-layer-color: map.get($systems, md-sys-color, on-secondary-container),
342342
ripple-color: mat.private-safe-color-change(
343343
map.get($systems, md-sys-color, on-secondary-container),
344344
$alpha: map.get($systems, md-sys-state, pressed-state-layer-opacity)
345345
),
346346
),
347347
tertiary: (
348348
foreground-color: map.get($systems, md-sys-color, on-tertiary-container),
349-
state-layer-color: map.get($systems, md-sys-color, tertiary-container),
349+
state-layer-color: map.get($systems, md-sys-color, on-tertiary-container),
350350
ripple-color: mat.private-safe-color-change(
351351
map.get($systems, md-sys-color, on-tertiary-container),
352352
$alpha: map.get($systems, md-sys-state, pressed-state-layer-opacity)
@@ -362,7 +362,7 @@
362362
@function fab-small($systems, $exclude-hardcoded) {
363363
@return ((
364364
foreground-color: map.get($systems, md-sys-color, on-primary-container),
365-
state-layer-color: map.get($systems, md-sys-color, primary-container),
365+
state-layer-color: map.get($systems, md-sys-color, on-primary-container),
366366
ripple-color: mat.private-safe-color-change(
367367
map.get($systems, md-sys-color, on-primary-container),
368368
$alpha: map.get($systems, md-sys-state, pressed-state-layer-opacity)
@@ -379,15 +379,15 @@
379379
primary: (), // Default, no overrides needed.
380380
secondary: (
381381
foreground-color: map.get($systems, md-sys-color, on-secondary-container),
382-
state-layer-color: map.get($systems, md-sys-color, secondary-container),
382+
state-layer-color: map.get($systems, md-sys-color, on-secondary-container),
383383
ripple-color: mat.private-safe-color-change(
384384
map.get($systems, md-sys-color, on-secondary-container),
385385
$alpha: map.get($systems, md-sys-state, pressed-state-layer-opacity)
386386
),
387387
),
388388
tertiary: (
389389
foreground-color: map.get($systems, md-sys-color, on-tertiary-container),
390-
state-layer-color: map.get($systems, md-sys-color, tertiary-container),
390+
state-layer-color: map.get($systems, md-sys-color, on-tertiary-container),
391391
ripple-color: mat.private-safe-color-change(
392392
map.get($systems, md-sys-color, on-tertiary-container),
393393
$alpha: map.get($systems, md-sys-state, pressed-state-layer-opacity)

src/material/core/tokens/m2/mdc/_extended-fab.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@ $prefix: (mdc, extended-fab);
88

99
@function get-unthemable-tokens() {
1010
@return (
11+
container-height: 48px,
12+
container-shape: 24px,
13+
1114
// =============================================================================================
1215
// = TOKENS NOT USED IN ANGULAR MATERIAL =
1316
// =============================================================================================
1417
container-color: null,
15-
container-height: null,
16-
container-shape: null,
1718
container-surface-tint-layer-color: null,
1819
focus-icon-color: null,
1920
focus-label-text-color: null,

0 commit comments

Comments
 (0)