Skip to content

fix(material/core): define token overrides inline #30646

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions src/material/core/tokens/_token-utils.scss
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,16 @@ $_system-fallbacks: m3-system.create-system-fallbacks();
// with https://sass-lang.com/documentation/breaking-changes/mixed-decls/. We should
// figure out a better way to do this or move all the concrete styles out of the theme.
& {
@each $key, $value in $tokens {
@if $value != null {
#{_create-var-name($prefix, $key)}: #{$value};
}
}
@include define-tokens($prefix, $tokens);
}
}
}

// Defines the CSS variables for the tokens.
@mixin define-tokens($prefix, $tokens) {
@each $key, $value in $tokens {
@if $value != null {
#{_create-var-name($prefix, $key)}: #{$value};
}
}
}
Expand Down Expand Up @@ -256,7 +261,7 @@ $_system-fallbacks: m3-system.create-system-fallbacks();
$data: map.get($prefixed-name-data, $name);
$namespace: list.nth($data, 1);
$name: list.nth($data, 2);
@include create-token-values(
@include define-tokens(
$namespace,
(
$name: $value,
Expand All @@ -268,7 +273,7 @@ $_system-fallbacks: m3-system.create-system-fallbacks();
@each $data in $datalist {
$namespace: list.nth($data, 1);
$prefixed-names: list.append($prefixed-names, list.nth($data, 2), $separator: comma);
@include create-token-values(
@include define-tokens(
$namespace,
(
$name: $value,
Expand Down
Loading