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 | 29 | 30 | 31 |
Tags
- 문자열
- 속성
- if else
- 함수선언식
- flex-direction
- 조건문
- properties
- 함수표현식
- for of
- 기초
- 반복문
- javascript
- align-content
- flex
- 화살표함수
- for
- boolean
- frontend
- 타입
- 프론트엔드
- 비교연산자
- typeof
- justify-content
- 함수
- for in
- ELSE
- flex-wrap
- Methods
- 논리연산자
- 변수
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 |