@stackr23/styleobjects

1.4.0 • Public • Published

@stackr23/styleobjects

transform stylesheets to JS objects

Build Status npm version Greenkeeper badge Maintenance PRs Welcome

style.css

.test   { font-size: 20px; }
.test23 { padding-top: 5px; }
.test23 .testInner { font-decoration: none; }

output.js

{
    test:   {'fontSize': '20px'},
    test23: {'fontSize': '23px'},
    test23__testInner: {'fontDecoration': 'none'}
}

CLI usage

npm install -g @stackr23/styleobjects  
npx @stackr/styleobjects --input ./style.css --output ./output.js

--input   - {String:path | String | URL | Buffer} - required
--outout - {String:path}

webpack usage

@stackr/styleobjects-loader

v2 roadmap

  • [ ] ? add eslint
  • [ ] refactor core
    • [ ] handle subclasses recursively
      • [x] transformToNestedDomStyleObjects() - recursively
    • [ ] use humps for camelization
    • [x] ES7
      • [x] @babel/register
      • [x] build into /dist
  • [x] mocha tests
    • [x] unit tests
    • [x] test /bin
  • [ ] proper option handling
    • [x] add yargs
    • [ ] --output-type as (json | module | echo)
  • [ ] DocBlocks // Comments

inspiration

Dependents (1)

Package Sidebar

Install

npm i @stackr23/styleobjects

Weekly Downloads

3

Version

1.4.0

License

ISC

Unpacked Size

34.4 kB

Total Files

12

Last publish

Collaborators

  • doubleu23