1.0.2 • Published 6 years ago

css-top-import v1.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

css-top-import stability

npm version downloads travis build

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