2016-12-21 18:43:31 +00:00
import { deprecated } from './utils'
2017-01-12 22:52:19 +00:00
const css = require ( 'glamor' )
2016-10-22 07:45:41 +00:00
2016-12-21 18:43:31 +00:00
for ( const [ k , v ] of Object . entries ( css ) ) {
if ( typeof v === 'function' ) {
2016-12-23 19:18:25 +00:00
css [ k ] = deprecated ( v , 'Warning: \'next/css\' is deprecated. Please refer to the migration guide: https://github.com/zeit/next.js/wiki/Migrating-from-next-css' )
2016-12-21 18:43:31 +00:00
}
}
2016-12-17 21:59:38 +00:00
2016-10-22 07:45:41 +00:00
/ * *
* 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