css2str
transform css to string that can be inserted by js
Last updated 10 years ago by popomore .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install css2str 
SYNC missed versions from official npm registry.

css2str Build Status Coverage Status

Transform css to string that can be inserted by js


Install

$ npm install css2str -g

Usage

var css2str = require('css2str');
var code = css2str(fs.readFileSync(filepath));

Then you can use import-style to import css in browser.

var importStyle = require('import-style');
importStyle(code);

Options

prefix

This option will add a parent selector of every selector.

// origin css

a {
  border: none;
}

// yield
.container a{border: none;}

With code

var opt = {prefix: '.container'}
var code = css2str(fs.readFileSync(filepath), opt);

LISENCE

Copyright (c) 2014 popomore. Licensed under the MIT license.

Current Tags

  • 0.1.1                                ...           latest (10 years ago)

2 Versions

  • 0.1.1                                ...           10 years ago
  • 0.1.0                                ...           11 years ago
Maintainers (1)
Downloads
Total 1
Today 1
This Week 1
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (4)
Dependents (0)
None

© 2010 - cnpmjs.org x YWFE | Home | YWFE