Skip to content

Commit bbc807a

Browse files
committed
fixup! test: Add additional tests and validation for theme definitions
1 parent b6e50c6 commit bbc807a

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/material-experimental/theming/_config-validation.scss

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@
55
@use '@angular/material' as mat;
66
@use './m3-palettes';
77

8-
/// Updates an error message by finding `$config` and appending a suffix to it.
8+
/// Creates an error message by finding `$config` in the existing message and appending a suffix to
9+
/// it.
910
/// @param {List|String} $err The error message.
1011
/// @param {String} $suffix The suffix to add.
1112
/// @return {List|String} The updated error message.
12-
@function _update-dollar-config($err, $suffix) {
13+
@function _create-dollar-config-error-message($err, $suffix) {
1314
@if meta.type-of($err) == 'list' {
1415
@for $i from 1 through list.length($err) {
15-
$err: list.set-nth($err, $i, _update-dollar-config(list.nth($err, $i), $suffix));
16+
$err: list.set-nth($err, $i,
17+
_create-dollar-config-error-message(list.nth($err, $i), $suffix));
1618
}
1719
}
1820
@else if meta.type-of($err) == 'string' {
@@ -66,15 +68,15 @@
6668
}
6769
$err: validate-color-config(map.get($config, color));
6870
@if $err {
69-
@return _update-dollar-config($err, '.color');
71+
@return _create-dollar-config-error-message($err, '.color');
7072
}
7173
$err: validate-typography-config(map.get($config, typography));
7274
@if $err {
73-
@return _update-dollar-config($err, '.typography');
75+
@return _create-dollar-config-error-message($err, '.typography');
7476
}
7577
$err: validate-density-config(map.get($config, density));
7678
@if $err {
77-
@return _update-dollar-config($err, '.density');
79+
@return _create-dollar-config-error-message($err, '.density');
7880
}
7981
@return null;
8082
}

0 commit comments

Comments
 (0)