mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
README: add more help on using Glamor (#165)
This commit is contained in:
parent
c5bbff412b
commit
47d0571341
|
@ -58,11 +58,13 @@ That means pages never load unnecessary code!
|
||||||
|
|
||||||
### CSS
|
### CSS
|
||||||
|
|
||||||
We use [glamor](https://github.com/threepointone/glamor) to provide a great built-in solution for CSS isolation and modularization without trading off any CSS features
|
We use [glamor](https://github.com/threepointone/glamor) to provide a great built-in solution for CSS isolation and modularization without trading off any CSS features.
|
||||||
|
|
||||||
|
Glamor's [HowTo](https://github.com/threepointone/glamor/blob/master/docs/howto.md) shows converting various CSS use cases to Glamor. See Glamor's [API docs](https://github.com/threepointone/glamor/blob/master/docs/api.md) for more details.
|
||||||
|
|
||||||
```jsx
|
```jsx
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import css from 'next/css'
|
import css, {insertRule} from 'next/css'
|
||||||
|
|
||||||
export default () => (
|
export default () => (
|
||||||
<div className={style}>
|
<div className={style}>
|
||||||
|
@ -70,6 +72,9 @@ export default () => (
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Global CSS rule
|
||||||
|
insertRule("html, body { margin: 0; padding: 0; }")
|
||||||
|
|
||||||
const style = css({
|
const style = css({
|
||||||
background: 'red',
|
background: 'red',
|
||||||
':hover': {
|
':hover': {
|
||||||
|
|
Loading…
Reference in a new issue