Created
March 19, 2019 21:26
-
-
Save maiquealmeida/df939945fb3b4ebc30c06b8178bad9a8 to your computer and use it in GitHub Desktop.
Utilizando GlobalStyles com styled-components
This file contains hidden or 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, { Component, Fragment } from 'react'; | |
import GlobalStyle from './styles/GlobalStyles'; | |
import Routes from './routes'; | |
class App extends Component { | |
state = {}; | |
render() { | |
return ( | |
<Fragment> | |
<GlobalStyle /> | |
<Routes /> | |
</Fragment> | |
); | |
} | |
} | |
export default App; |
This file contains hidden or 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"; | |
const GlobalStyle = createGlobalStyle` | |
* { | |
padding: 0; | |
margin: 0; | |
outline: 0; | |
} | |
html, body { | |
height: 100%; | |
width: 100%; | |
background: #f7f7f7; | |
text-rendering: optimizeLegibility !important; | |
-webkit-font-smoothing: antialiased !important; | |
-moz-osx-font-smoothing: grayscale !important; | |
} | |
div#root{ | |
width: 100%; | |
height: 100%; | |
} | |
input { | |
outline: 0; | |
} | |
`; | |
export default GlobalStyle; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment