Skip to content

Commit da4e069

Browse files
committed
fix(themes): fallback to base if foreground is undefined
1 parent 6d05513 commit da4e069

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

core/src/themes/functions.color.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@
3939

4040
$value: map.get($values, $variation);
4141

42+
// TODO(): this can be removed when foreground is required
43+
// Fallback to "base" variant when "foreground" variant is undefined
44+
@if ($variation == foreground and $value == null) {
45+
$variation: base;
46+
$value: map.get($values, $variation);
47+
}
48+
4249
// If the color requested is subtle we return `--ion-color-{color}-subtle-contrast`,
4350
// otherwise we return `--ion-color-{color}-contrast`.
4451
$variable: if($subtle, "--ion-color-#{$name}-subtle-#{$variation}", "--ion-color-#{$name}-#{$variation}");

0 commit comments

Comments
 (0)