diff --git a/Global-styles-and-layouts.md b/Global-styles-and-layouts.md index ed0909e..84bd777 100644 --- a/Global-styles-and-layouts.md +++ b/Global-styles-and-layouts.md @@ -4,72 +4,60 @@ This page will answer how to set global styles like - CSS resets, such as `* { box-sizing: border-box; margin: 0; padding: 0 }` - Any other styles you might want on `
` or ` -The easiest way to accomplish it is by using the [`` component](https://github.com/zeit/next.js#head-side-effects). For example, in `pages/index.js`: +The easiest way to accomplish it is by using the [` - + ) ``` -When the page is rendered, the ` - - -) -``` +Notice that `components/` is completely arbitrary, but I happen to like that structure. Then `components/meta.js` can introduce the `` with ``, so that it can be applied to every page. It's also possible to create "master layouts" that embed these components on your behalf, by leveraging React's `children` property. @@ -77,7 +65,7 @@ For example, you can introduce `layouts/main.js`: ``` components/ - header.js + meta.js footer.js pages/ index.js @@ -88,22 +76,20 @@ layouts/ and the component can act as a wrapper: ```jsx -import React from 'react' -import Header from '../components/header' +import Meta from '../components/meta' import Footer from '../components/footer' export default ({ children }) => (