Skip to content

Commit 353de23

Browse files
committed
fix(theme): Fixed rmd-theme-get-swatch to loop over all rmd-theme-colors instead of the primaries only
I probably should have added some other `@if`s to this after the looping to ensure a color has been found, but the checks before this point should really catch the other cases. Because this only looped over the primary colors, if you set the `$rmd-theme-primary: $rmd-green-500;`, this color would be resolved as `$rmd-green-500-300` in the chip package for the `$rmd-chip-themed-background-color` variable which threw an error when trying to do color contrast ratio fixes in `$rmd-chip-themed-color`. Closes #884
1 parent defb7d5 commit 353de23

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/theme/src/_functions.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
} @else {
8585
$index: 1;
8686
$found: false;
87-
@while not $found and $index < length($rmd-theme-primary-suffixes) {
87+
@while not $found and $index < length($rmd-theme-colors) {
8888
$suffix: nth($rmd-theme-colors, $index);
8989
$suffix-index: str-index($current-color-name, $suffix);
9090
@if $suffix-index {

0 commit comments

Comments
 (0)