Skip to content

Commit 94d8997

Browse files
committed
fix(material-experimental/theming): fix border radius of filled form field
The M3 tokens were providing the filled form field `container-shape` token as a list instead of a single value which was producing an invalid value when compiled.
1 parent d1ceb6b commit 94d8997

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@use 'sass:map';
2+
@use 'sass:list';
23
@use 'sass:meta';
34
@use '@angular/material' as mat;
45
@use '@material/tokens/v0_161' as mdc-tokens;
@@ -243,7 +244,14 @@
243244
)
244245
));
245246

246-
// TODO(crisbeto): also needs to fix the container-shape here.
247+
$container-shape: map.get($tokens, container-shape);
248+
249+
// The M2 token slots define a single `container-shape` slot while the M3 tokens provide a list
250+
// of shapes (e.g. top/bottom/left/right). Extract the first value so it matches the expected
251+
// token slot in M2.
252+
@if meta.type-of($container-shape) == 'list' {
253+
$tokens: map.set($tokens, container-shape, list.nth($container-shape, 1));
254+
}
247255

248256
@return $tokens;
249257
}

0 commit comments

Comments
 (0)