css-top-import
v1.0.2
Published
put `@import` to the top of css
Downloads
6
Readme
css-top-import
put @import url(...)
to the top of css
usage
/* before */
pre {
position: relative;
line-height: 0 !important;
border: 1px solid;
border-left: 6px solid;
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
}
@import url('http://fonts.googleapis.com/css?family=Lato');
// run
var cssTopImport = require('css-top-import')
cssTopImport(src, result => {
console.log(result)
})
/* after */
@import url('http://fonts.googleapis.com/css?family=Lato');
pre {
position: relative;
line-height: 0 !important;
border: 1px solid;
border-left: 6px solid;
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
}
api
cssTopImport(src, done)
src
css source
done(result)
called with the compiled css
why
e.g. import web font from google api, you need to put the @import
statement top of the css in order to work out.
license
MIT