Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- 변수
- for in
- 타입
- ELSE
- frontend
- javascript
- flex
- 프론트엔드
- flex-wrap
- 문자열
- properties
- if else
- 조건문
- flex-direction
- 화살표함수
- justify-content
- 속성
- 함수선언식
- for of
- 논리연산자
- for
- 함수표현식
- align-content
- 기초
- 함수
- boolean
- 반복문
- Methods
- typeof
- 비교연산자
Archives
- Today
- Total
하얀 코딩
[Styled Component - 5] keyframes 본문
styled-components에서 keyframes 함수를 사용하여 CSS 애니메이션을 정의할 수 있습니다.
keyframes 함수를 사용하면 애니메이션의 이름과 애니메이션 키프레임을 정의할 수 있습니다.
import styled, { keyframes } from 'styled-components';
// keyframes로 회전 애니메이션 정의
const rotateAnimation = keyframes`
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
`;
// 애니메이션을 적용할 컴포넌트
const AnimatedDiv = styled.div`
width: 100px;
height: 100px;
background-color: #fca311;
animation: ${rotateAnimation} 2s linear infinite;
`;
export default AnimatedDiv;
'Styled Components' 카테고리의 다른 글
[Styled Component - 7] & (1) | 2023.06.05 |
---|---|
[Styled Component - 6] ThemeProvider (0) | 2023.06.05 |
[Styled Component - 3] attrs (0) | 2023.06.02 |
[Styled Component - 2] Props 활용하기 (0) | 2023.06.02 |
[Styled Component - 1] 기본 사용법 (0) | 2023.06.02 |