Skip to content

Commit

Permalink
feat: add missing animations
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenVAIDIE committed Sep 11, 2020
1 parent 65da7fe commit 87aba67
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions akeneo-design-system/src/components/Checkbox/Checkbox.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
import React from 'react';
import styled, {css} from 'styled-components';
import styled, {css, keyframes} from 'styled-components';
import {CheckIcon, PartialCheckIcon} from '../../icons';

const checkTick = keyframes`
to {
stroke-dashoffset: 0;
}
`;

const uncheckTick = keyframes`
to {
stroke-dashoffset: 20px;
}
`;

const Container = styled.div`
display: flex;
`;

const TickIcon = styled(CheckIcon)`
animation: uncheckTick 0.2s ease-in forwards;
animation: ${uncheckTick} 0.2s ease-in forwards;
opacity: 0;
stroke-dasharray: 0px;
stroke-dashoffset: 0;
Expand All @@ -28,7 +40,7 @@ const CheckboxContainer = styled.div <{ checked: boolean, readOnly: boolean }>`
background-color: ${({theme}) => theme.palette.checkbox.checked.backgroundColor};
${TickIcon} {
animation-delay: 0.2s;
animation: checkTick 0.2s ease-out forwards;
animation: ${checkTick} 0.2s ease-out forwards;
stroke-dashoffset: 20px;
opacity: 1;
transition-delay: 0s;
Expand Down

0 comments on commit 87aba67

Please sign in to comment.