fix(Button): should hide border when color is linear-gradient (#4342)

This commit is contained in:
neverland
2019-09-03 16:08:40 +08:00
committed by GitHub
parent d8bd873318
commit 252bd25662
4 changed files with 20 additions and 4 deletions

View File

@@ -57,16 +57,22 @@ function Button(
loadingText
} = props;
const style: Record<string, string> = {};
const style: Record<string, string | number> = {};
if (color) {
style.borderColor = color;
style.color = plain ? color : WHITE;
if (!plain) {
// Use background instead of backgroundColor to make linear-gradient work
style.background = color;
}
// hide border when color is linear-gradient
if (color.indexOf('gradient') !== -1) {
style.border = 0;
} else {
style.borderColor = color;
}
}
function onClick(event: Event) {