Skip to content

Commit

Permalink
Merge pull request #39 from zeit/add/css-default-export
Browse files Browse the repository at this point in the history
Exposing glamor style as default
  • Loading branch information
nkzawa committed Oct 25, 2016
2 parents 09a9eb0 + 6743e2b commit 1952a47
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion 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

0 comments on commit 1952a47

Please sign in to comment.