fix(color): do not accept empty color

fixes #15732
This commit is contained in:
Manu Mtz.-Almeida
2018-09-25 20:09:04 +02:00
parent 273ed4dd3d
commit ede5525342

View File

@ -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;