Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Commit

Permalink
fix: icon button transition happening when undesired (#313)
Browse files Browse the repository at this point in the history
fix: icon button transition
  • Loading branch information
KaWaite authored Sep 8, 2022
1 parent 893d32f commit 6a6d98e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/components/atoms/Button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ const StyledButton = styled.button<ButtonProps>`
align-items: center;
display: flex;
align-items: center;
transition: all 0.4s;
transition-property: color, background;
transition-duration: 0.4s;
&:hover {
background: ${({ buttonType, disabled, theme }) =>
Expand Down
3 changes: 2 additions & 1 deletion src/components/atoms/Icon/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ const StyledSvg = styled(SVG)<{ color?: string; size?: string; notransition?: bo
width: ${({ size }) => size};
height: ${({ size }) => size};
color: ${({ color }) => color};
${({ notransition }) => !notransition && "transition: all 0.4s;"}
transition-property: color, background;
${({ notransition }) => (!notransition ? "transition-duration: 0.4s;" : undefined)}
`;

export default memo(Icon);

0 comments on commit 6a6d98e

Please sign in to comment.