mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
@ -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
|
* Create the mode and color classes for the component based on the classes passed in
|
||||||
*/
|
*/
|
||||||
export function createColorClasses(color: Color | undefined | null): CssClassMap | undefined {
|
export function createColorClasses(color: Color | undefined | null): CssClassMap | undefined {
|
||||||
return (color != null) ? {
|
return (typeof color === 'string' && color.length > 0) ? {
|
||||||
'ion-color': true,
|
'ion-color': true,
|
||||||
[`ion-color-${color}`]: true
|
[`ion-color-${color}`]: true
|
||||||
} : undefined;
|
} : undefined;
|
||||||
|
Reference in New Issue
Block a user