TIL 201004

Wontae·2020년 10월 4일
0
const menuAnimation = keyframes`
  0% {
    opacity: 0;
    transform: translateY(-20px)
  }
  100% {
    opacity: 1;
    transform: translateY(0)
  }
`;


const Product = styled.div`
  animation: none;
  ...

  ${(props) => {
    return (
      props.isActive &&
      css`
        animation: ${menuAnimation} 1s forwards;
        animation-delay: ${props.index * 0.1}s;
      `
    );
  }};
`;

styled-components 에서 키프레임 활용하기

profile
안녕하세요! 프론트엔드 개발자 정원태입니다.

0개의 댓글