Use the built-in utilities instead.
{{< theme-colors.inline >}}
{{- range (index $.Site.Data "theme-colors") }}
<div class="col-md-4">
- <div class="p-3 mb-3 swatch-{{ .name }}">{{ .name | title }}</div>
+ <div class="p-3 mb-3 bg-{{ .name }} {{ if or (eq .name "light") (eq .name "warning") }}text-dark{{ else }}text-white{{ end }}">{{ .name | title }}</div>
</div>
{{ end -}}
{{< /theme-colors.inline >}}
}
}
-@each $color, $value in $theme-colors {
- .swatch-#{$color} {
- color: color-yiq($value);
- background-color: #{$value};
- }
-}
-
@each $color, $value in $grays {
.swatch-#{$color} {
color: color-yiq($value);