Skip to content

Utility to convert Cascading Style Sheets (CSS) to JSON objects and vice versa.

License

Notifications You must be signed in to change notification settings

arajajyothibabu/json-css

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JSON-CSS | CSS-JSON

Utility to convert Cascading Style Sheets (CSS) to JSON objects and vice versa.

npm version

  • Yet to support media queries
  • Yet to support Files

Import:

  • Installing with NPM

      npm install json-css --save
    
  • Import in es6

      import JsonCSS from 'json-css';
    
  • Import through require in es5

      var JsonCSS = require('json-css');
    

Usage

  • to JSON with CSS as input type string

      JsonCSS.toJSON(`
          h1 {
              color: #F1F1F1;
          }
      `);
    
  • to CSS with JSON as input type object

      JsonCSS.toCSS({
          h1: {
              color: "#F1F1F1"
          }
      });