Created
July 20, 2020 15:59
-
-
Save niikkiin/44be6d8e8f1525df5c55515dcecf0e09 to your computer and use it in GitHub Desktop.
For creating global styles with reset using styled-components
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
// import the global styles | |
import { GlobalStyles } from 'utilities/styles/global.styles'; | |
function App() { | |
return ( | |
<> | |
<GlobalStyles /> | |
Hello carrots | |
</> | |
); | |
} | |
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createGlobalStyle } from 'styled-components'; | |
export const GlobalStyles = createGlobalStyle` | |
*, | |
*::before, | |
*::after { | |
margin: 0; | |
padding: 0; | |
box-sizing: inherit; | |
} | |
html { | |
font-size: 62.5%; /* equivalent to 10px; 1rem = 10px; 10px/16px */ | |
} | |
body { | |
box-sizing: border-box; | |
font-family: 'Muli', sans-serif; | |
} | |
`; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment