바르고 뜨겁게
React Js - Global CSS 설정 + styled reset 본문
React Js - Global CSS 설정 + styled reset
css 초기화를 위해
styled-reset
설치styled-components
는 local로 동작하기 때문에 global 한 css 를 만들기 위해 GlobalStyles.js 생성
설치
yarn add styled-reset
사용
Components/GlobalStyles.js
import { createGlobalStyle } from "styled-components";
import reset from "styled-reset";
const globalStyles = createGlobalStyle`
${reset};
a{
text-decoration:none;
color:inherit;
}
*{
box-sizing:boerder-box;
}
body{
font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
font-size: 14px;
background-color:rgba(20,20,20,1);
}
`;
export default globalStyles;Components/App.js
import React, { Component } from "react";
import Router from "Components/Router";
import GlobalStyles from "Components/GlobalStyles";
class App extends Component {
render() {
return (
<>
<Router />
<GlobalStyles />
</>
);
}
}
export default App;
'자바스크립트 > React Js' 카테고리의 다른 글
React Js - Rest API 사용 (Axios) (0) | 2019.05.30 |
---|---|
React Js - [SC] 동적인 UI 처리하기 props, withRouter (0) | 2019.05.29 |
React Js - styled components (0) | 2019.05.25 |
React Js - CSS 모듈 (0) | 2019.05.24 |
React Js - Router (URL 연결, 화면 렌더링) (0) | 2019.05.23 |
Comments