mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 20:33:32 +08:00
fix(button): corrected issue with colors required for styles.
This commit is contained in:
@ -182,10 +182,7 @@ export class Button {
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
getColorClassList(color: string, role: string, style: string, mode: string): string | null {
|
||||
if (!color) {
|
||||
return null;
|
||||
}
|
||||
getColorClassList(color: string, role: string, style: string, mode: string): string[] {
|
||||
style = (role !== 'bar-button' && style === 'solid') ? 'default' : style;
|
||||
let className =
|
||||
role +
|
||||
@ -193,16 +190,13 @@ export class Button {
|
||||
'-' + style.toLowerCase() :
|
||||
'');
|
||||
|
||||
console.log(role, style, className, mode, color);
|
||||
|
||||
return `${className}-${mode}-${color}`;
|
||||
return [].concat(
|
||||
`${className}-${mode}`,
|
||||
color ? `${className}-${mode}-${color}` : []
|
||||
);
|
||||
}
|
||||
|
||||
getStyleClassList(role: string): string[] {
|
||||
if (!this.color) {
|
||||
return [];
|
||||
}
|
||||
|
||||
var classList = [].concat(
|
||||
this.outline ? this.getColorClassList(this.color, role, 'outline', this.mode) : [],
|
||||
this.clear ? this.getColorClassList(this.color, role, 'clear', this.mode) : [],
|
||||
|
Reference in New Issue
Block a user