반응형 styled1 styled-component(1) styled-component 설치 : 해당 프로젝트의 디렉토리에서 실행 npm i styled-components 사용방법 import styled from "styled-components"; const div = styled.div``; // back tick (숫자 1 왼쪽 옆에 있는것)을 입력하고 그 사이에 스타일을 작성한다. const div = styled.div` background-color: red; width: 100px; height: 100px; `; styled-component에 props 전달 const Div = styled.div` background-color: ${(props) => props.bgColor}; width: 100px; height: 100px; `; .. 2022. 7. 11. 이전 1 다음 반응형