Skip to content

Commit

Permalink
fix: Button icon hover delay (#1135)
Browse files Browse the repository at this point in the history
  • Loading branch information
brettdorrans committed Jun 26, 2022
1 parent 7ca3556 commit 8355057
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 30 deletions.
4 changes: 2 additions & 2 deletions src/components/button/Button.stories.tsx
@@ -1,5 +1,5 @@
import * as React from 'react';
import { faCircleCheck } from '@fortawesome/free-solid-svg-icons';
import { faXmark } from '@fortawesome/free-solid-svg-icons';
import { ThemeProvider } from '../theme-provider';
import { Button } from './index';

Expand Down Expand Up @@ -46,6 +46,6 @@ Grey.args = {
export const WithIcon = DefaultTemplate.bind({});
WithIcon.args = {
kind: 'primary',
icon: faCircleCheck,
icon: faXmark,
styles: templateStyles
};
37 changes: 15 additions & 22 deletions src/components/button/__snapshots__/Button.spec.tsx.snap
Expand Up @@ -174,36 +174,29 @@ exports[`it works with icon 1`] = `
align-items: center;
}
.c2 {
margin-right: 0.5rem;
}
<button
class="c0"
type="button"
>
<div
class="c1"
>
<div
class="c2"
<svg
aria-hidden="true"
class="svg-inline--fa fa-circle "
data-icon="circle"
data-prefix="fas"
focusable="false"
role="img"
style="margin-right: 0.5rem;"
viewBox="0 0 512 512"
xmlns="http://www.w3.org/2000/svg"
>
<svg
aria-hidden="true"
class="svg-inline--fa fa-circle "
data-icon="circle"
data-prefix="fas"
focusable="false"
role="img"
viewBox="0 0 512 512"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256z"
fill="currentColor"
/>
</svg>
</div>
<path
d="M512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256z"
fill="currentColor"
/>
</svg>
Hello world
</div>
</button>
Expand Down
7 changes: 4 additions & 3 deletions src/components/button/index.tsx
Expand Up @@ -54,9 +54,10 @@ const BaseButton: React.FC<ButtonPropType & ButtonProps> = ({
}}
>
{icon && (
<Box styles={{ marginRight: '2' }}>
<FontAwesomeIcon icon={icon} />
</Box>
<FontAwesomeIcon
style={{ marginRight: '0.5rem' }}
icon={icon}
/>
)}
{children}
</Box>
Expand Down
6 changes: 3 additions & 3 deletions src/components/theme-provider/index.tsx
Expand Up @@ -26,9 +26,9 @@ const GlobalStyle = createGlobalStyle`
font-size: 100%;
font: inherit;
vertical-align: baseline;
transition: color 0.12s cubic-bezier(0.6, 0.04, 0.98, 0.7) 0s,
border 0.12s cubic-bezier(0.6, 0.04, 0.98, 0.7) 0s,
background-color 0.12s cubic-bezier(0.6, 0.04, 0.98, 0.7) 0s;
transition: color 0.08s cubic-bezier(0.6, 0.04, 0.98, 0.7) 0s,
border 0.08s cubic-bezier(0.6, 0.04, 0.98, 0.7) 0s,
background-color 0.08s cubic-bezier(0.6, 0.04, 0.98, 0.7) 0s;
}
html { box-sizing: border-box; }
*, *:before, *:after { box-sizing: inherit; }
Expand Down

0 comments on commit 8355057

Please sign in to comment.