npm-css
Require css from npm
Last updated 7 years ago by shtylman .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install npm-css 
SYNC missed versions from official npm registry.

npm-css

Require css from node modules.

Syntax

@import "typeahead";

@import "./foo.css";
@import "./bar/baz.css";

.foo {
    color: red
}

npm-css reads css imports in the format of @import " ... " and inlines the CSS at that path for you. It also understands node modules.

If you @import a folder it will try to look for a package.json file or read index.css by default. See the package.json section below.

CLI

To build a single css file from an entry.css with @import statements.

npm-css entry.css -o bundle.css

API

If you want to build css files on the fly.

var npmcss = require('npm-css');
var css = npmcss(/path/to/file);

package.json

You can specify the stylesheet for your module by adding a "style" field to your package.json file. This works similarly to the "main" field.

Installation

npm install npm-css

MIT Licenced

Current Tags

  • 0.2.3                                ...           latest (7 years ago)

5 Versions

  • 0.2.3                                ...           7 years ago
  • 0.2.2                                ...           7 years ago
  • 0.2.1                                ...           7 years ago
  • 0.2.0                                ...           8 years ago
  • 0.1.0                                ...           8 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 3
Dependencies (4)
Dev Dependencies (1)

Copyright 2014 - 2017 © taobao.org |