Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(button): remove danger ghost icon only button svg margin #7618

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion packages/components/src/components/button/_button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@
position: static;
}

&.#{$prefix}--btn--ghost .#{$prefix}--btn__icon {
&.#{$prefix}--btn--ghost .#{$prefix}--btn__icon,
&.#{$prefix}--btn--danger--ghost .#{$prefix}--btn__icon {
margin: 0;
}
}
Expand Down Expand Up @@ -309,6 +310,17 @@
color: $text-04;
border-color: $active-danger;
}

&:disabled,
&:hover:disabled,
&:focus:disabled,
&.#{$prefix}--btn--disabled,
&.#{$prefix}--btn--disabled:hover,
&.#{$prefix}--btn--disabled:focus {
color: $disabled-03;
background: transparent;
outline: none;
}
}

// TODO: deprecate single dash ghost
Expand Down
18 changes: 6 additions & 12 deletions packages/react/src/components/Button/Button-story.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ const kinds = {
'Secondary button (secondary)': 'secondary',
'Tertiary button (tertiary)': 'tertiary',
'Danger button (danger)': 'danger',
'Danger tertiary button (danger--tertiary)': 'danger--tertiary',
'Danger ghost button (danger--ghost)': 'danger--ghost',
'Ghost button (ghost)': 'ghost',
};

Expand Down Expand Up @@ -73,17 +75,7 @@ const props = {
}
return {
className: 'some-class',
kind: select(
'Button kind (kind)',
{
'Primary button (primary)': 'primary',
'Secondary button (secondary)': 'secondary',
'Tertiary button (tertiary)': 'tertiary',
'Ghost button (ghost)': 'ghost',
'Danger button (danger)': 'danger',
},
'primary'
),
kind: select('Button kind (kind)', kinds, 'primary'),
disabled: boolean('Disabled (disabled)', false),
size: select('Button size (size)', sizes, 'default'),
renderIcon: !iconToUse || iconToUse.svgData ? undefined : iconToUse,
Expand Down Expand Up @@ -184,7 +176,9 @@ export const Playground = () => {
}}>
<Button {...regularProps}>Button</Button>
&nbsp;
<Button hasIconOnly {...iconOnly}></Button>
{!regularProps.kind.includes('danger') && (
<Button hasIconOnly {...iconOnly}></Button>
)}
</div>
<div
style={{
Expand Down