Skip to content

Instantly share code, notes, and snippets.

@maiquealmeida
Created March 19, 2019 21:26
Show Gist options
  • Save maiquealmeida/df939945fb3b4ebc30c06b8178bad9a8 to your computer and use it in GitHub Desktop.
Save maiquealmeida/df939945fb3b4ebc30c06b8178bad9a8 to your computer and use it in GitHub Desktop.
Utilizando GlobalStyles com styled-components
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;
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