mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
Merge pull request #39 from zeit/add/css-default-export
Exposing glamor style as default
This commit is contained in:
commit
1952a47a90
21
lib/css.js
21
lib/css.js
|
@ -1 +1,20 @@
|
|||
module.exports = require('glamor')
|
||||
const css = require('glamor')
|
||||
|
||||
/**
|
||||
* Expose style as default and the whole object as properties
|
||||
* so it can be used as follows:
|
||||
*
|
||||
* import css, { merge } from 'next/css'
|
||||
* css({ color: 'red' })
|
||||
* merge({ color: 'green' })
|
||||
* css.merge({ color: 'blue' })
|
||||
*/
|
||||
|
||||
css.default = css.style
|
||||
Object.keys(css).forEach(key => {
|
||||
if (key !== 'default') {
|
||||
css.default[key] = css[key]
|
||||
}
|
||||
})
|
||||
|
||||
module.exports = css
|
||||
|
|
Loading…
Reference in a new issue