Skip to content

Commit

Permalink
fix(material-experimental/theming): fix border radius of filled form …
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
crisbeto committed Dec 21, 2023
1 parent d1ceb6b commit 94d8997
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/material-experimental/theming/_m3-tokens.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@use 'sass:map';
@use 'sass:list';
@use 'sass:meta';
@use '@angular/material' as mat;
@use '@material/tokens/v0_161' as mdc-tokens;
Expand Down Expand Up @@ -243,7 +244,14 @@
)
));

// TODO(crisbeto): also needs to fix the container-shape here.
$container-shape: map.get($tokens, container-shape);

// The M2 token slots define a single `container-shape` slot while the M3 tokens provide a list
// of shapes (e.g. top/bottom/left/right). Extract the first value so it matches the expected
// token slot in M2.
@if meta.type-of($container-shape) == 'list' {
$tokens: map.set($tokens, container-shape, list.nth($container-shape, 1));
}

@return $tokens;
}
Expand Down

0 comments on commit 94d8997

Please sign in to comment.