From ede5525342be8175a773d7fd86b261aa0c552f70 Mon Sep 17 00:00:00 2001 From: "Manu Mtz.-Almeida" Date: Tue, 25 Sep 2018 20:09:04 +0200 Subject: [PATCH] fix(color): do not accept empty color fixes #15732 --- core/src/utils/theme.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/utils/theme.ts b/core/src/utils/theme.ts index 6b91e65fd9..e03e1f2883 100644 --- a/core/src/utils/theme.ts +++ b/core/src/utils/theme.ts @@ -8,7 +8,7 @@ export function hostContext(selector: string, el: HTMLElement): boolean { * Create the mode and color classes for the component based on the classes passed in */ export function createColorClasses(color: Color | undefined | null): CssClassMap | undefined { - return (color != null) ? { + return (typeof color === 'string' && color.length > 0) ? { 'ion-color': true, [`ion-color-${color}`]: true } : undefined;