mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-31 05:03:21 +08:00
ADD gray button
This commit is contained in:
parent
0fad41972d
commit
2c92063c76
@ -7,6 +7,7 @@ export interface ButtonProps {
|
||||
primary?: boolean;
|
||||
secondary?: boolean;
|
||||
tertiary?: boolean;
|
||||
gray?: boolean;
|
||||
inForm?: boolean;
|
||||
disabled?: boolean;
|
||||
small?: boolean;
|
||||
@ -78,7 +79,7 @@ const ButtonWrapper = styled.button<ButtonWrapperProps>(
|
||||
...(small ? { padding: 9 } : { padding: 12 }),
|
||||
}
|
||||
: {},
|
||||
({ theme, primary, secondary }) => {
|
||||
({ theme, primary, secondary, gray }) => {
|
||||
let color;
|
||||
|
||||
if (primary) {
|
||||
@ -87,11 +88,14 @@ const ButtonWrapper = styled.button<ButtonWrapperProps>(
|
||||
if (secondary) {
|
||||
color = theme.color.secondary;
|
||||
}
|
||||
if (gray) {
|
||||
color = theme.color.medium;
|
||||
}
|
||||
|
||||
return color
|
||||
? {
|
||||
background: color,
|
||||
color: theme.color.lightest,
|
||||
color: gray ? '#333333' : theme.color.inverseText,
|
||||
|
||||
'&:hover': {
|
||||
background: darken(0.05, color),
|
||||
|
Loading…
x
Reference in New Issue
Block a user