Skip to content
Merged
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
15 changes: 15 additions & 0 deletions src/material/core/tokens/_system.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
@use '../style/sass-utils';
@use './m2';
@use './m3';
@use 'sass:list';
@use 'sass:map';
@use 'sass:meta';

Expand Down Expand Up @@ -328,6 +329,20 @@
'configs created with define-light-theme or define-dark-theme';
}

// Check whether any override keys do not match keys in the theme
// config system map.
$invalid-keys: ();
$config-system: map.get($theme-config, _mat-system);
@each $key, $value in $overrides {
@if (not map.has-key($config-system, $key)) {
$invalid-keys: list.append($invalid-keys, $key);
}
}
@if (list.length($invalid-keys) > 0) {
@error 'The following overrides are not valid system variables: #{$invalid-keys}. ' +
'Valid keys are: #{map.keys($config-system)}';
}

$config: m2-inspection.get-m2-config($theme-config);

$color: map.get($config, color);
Expand Down
Loading