Skip to content

varemenos/cssrules

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cssrules

npm Build Status Dependency Status Coverage Status

About

CSS in JS via the CSSStylesheet API

Description

This library takes a CSS string and outputs an Array of Strings that are consumable by the CSSStylesheet API

Installation

npm install --save cssrules

Usage

Example #1

const cssrules = require('cssrules');

cssrules(`.myrule { color: red; }`)
  .then(output => {
      console.log(output);
  });

Example #2

const cssrules = require('cssrules');
const fs = require('fs');
const path = require('path');
const myCssFile = fs.readFileSync(path.resolve('./my_file.css', 'utf8'));

cssrules(myCssFile)
  .then(output => {
      console.log(output);
  });

Integrations

About

CSS in JS via the CSSStylesheet API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%