Skip to content

Commit

Permalink
fix(theme): Fixed rmd-theme-get-swatch to loop over all `rmd-theme-…
Browse files Browse the repository at this point in the history
…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 353de23
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/theme/src/_functions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 353de23

Please sign in to comment.