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