|
5 | 5 | @use '@angular/material' as mat; |
6 | 6 | @use './m3-palettes'; |
7 | 7 |
|
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. |
9 | 10 | /// @param {List|String} $err The error message. |
10 | 11 | /// @param {String} $suffix The suffix to add. |
11 | 12 | /// @return {List|String} The updated error message. |
12 | | -@function _update-dollar-config($err, $suffix) { |
| 13 | +@function _create-dollar-config-error-message($err, $suffix) { |
13 | 14 | @if meta.type-of($err) == 'list' { |
14 | 15 | @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)); |
16 | 18 | } |
17 | 19 | } |
18 | 20 | @else if meta.type-of($err) == 'string' { |
|
66 | 68 | } |
67 | 69 | $err: validate-color-config(map.get($config, color)); |
68 | 70 | @if $err { |
69 | | - @return _update-dollar-config($err, '.color'); |
| 71 | + @return _create-dollar-config-error-message($err, '.color'); |
70 | 72 | } |
71 | 73 | $err: validate-typography-config(map.get($config, typography)); |
72 | 74 | @if $err { |
73 | | - @return _update-dollar-config($err, '.typography'); |
| 75 | + @return _create-dollar-config-error-message($err, '.typography'); |
74 | 76 | } |
75 | 77 | $err: validate-density-config(map.get($config, density)); |
76 | 78 | @if $err { |
77 | | - @return _update-dollar-config($err, '.density'); |
| 79 | + @return _create-dollar-config-error-message($err, '.density'); |
78 | 80 | } |
79 | 81 | @return null; |
80 | 82 | } |
|
0 commit comments