파일 구조
src/Components/GlobalStyles.js
src/Components/App.js
추가한 패키지
yarn add styled-reset
GlobalStyles.js
import { createGlobalStyle } from "styled-components";
import reset from "styled-reset";
const GlobalStyles = createGlobalStyle`
${reset}
a{
text-decoration:none;
color:inherit;
}
*{
box-sizing:border-box;
}
body{
font-size:14px;
background-color:rgba(20,20,20,0.5);
padding-top:50px;
}
`;
export default GlobalStyles;
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 />
</>
)
}