Skip to content
Permalink
Browse files
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
  • Loading branch information
mlaursen committed Jul 21, 2020
1 parent defb7d5 commit 353de2368f9aad74add60559bb6489692b1e2c62
Showing 1 changed file with 1 addition and 1 deletion.
@@ -84,7 +84,7 @@
} @else {
$index: 1;
$found: false;
@while not $found and $index < length($rmd-theme-primary-suffixes) {
@while not $found and $index < length($rmd-theme-colors) {
$suffix: nth($rmd-theme-colors, $index);
$suffix-index: str-index($current-color-name, $suffix);
@if $suffix-index {

0 comments on commit 353de23

Please sign in to comment.