🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more →
Socket
Book a DemoInstallSign in
Socket

css-top-import

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

css-top-import

put `@import` to the top of css

latest
Source
npmnpm
Version
1.0.2
Version published
Weekly downloads
7
-30%
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

javascript

FAQs

Package last updated on 16 Jan 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts