반응형
Gatby 스타일링 방법은 여러가지가 있는데 그중 Styled Component를 사용하려 한다.
npm install gatsby-plugin-styled-components styled-components babel-plugin-styled-components
gatsby 디렉토리에 설치하고 gatsby-config.js파일에 Styled Component 플러그인을 추가한다.
Copygatsby-config.js
module.exports = {
plugins: [`gatsby-plugin-styled-components`],
}
이제 js파일에서 import 하고 원하는 스타일로 꾸미면 되겠다
import React from "react"
import styled from "styled-components"
const Container = styled.div`
display: flex;
background-color: white;
`
반응형
'Dev > React' 카테고리의 다른 글
[React] Each child in a list should have a unique "key" prop. 리액트 키값 오류 (0) | 2021.12.04 |
---|---|
Gatsby Blog height 100% 개츠비 블로그 높이 100% 설정방법 /개발 블로그 제작기 (0) | 2021.11.12 |
Gatsby 블로그 상단 메뉴바 고정시키기 /개발 블로그 제작기 (0) | 2021.11.10 |
Gatsby 블로그 styled-component로 global style 설정하기 (createGlobalStyle) /개발 블로그 제작기 (0) | 2021.11.10 |
Gatsby Blog Create 개츠비 블로그 만들기/ 개발 블로그 제작기 (0) | 2021.11.01 |