cssobject-from-selector

1.0.2 • Public • Published

cssobject-from-selector

experimental

Pass an object defining css a function will be returned. Pass selectors to the returned function to get merged css objects

Usage

NPM

var cssFromSelector = require('cssobject-from-selector');
 
var getCSS = cssFromSelector( {
 
    'div': {
        width: '100px'
    },
 
    'ul': {
        width: '50px'
    },
 
    '.red': {
        color: '#F00'
    },
 
    '.red.tall': {
        height: '100px'
    },
 
    '.red.small': {
        height: '50px'
    }
});
 
var css = getCSS('div.red.tall');
 
// css will be
// {
//  width: '100px',
//  height: '100px',
//  color: '#F00'
// }

License

MIT, see LICENSE.md for details.

Readme

Keywords

Package Sidebar

Install

npm i cssobject-from-selector

Weekly Downloads

2

Version

1.0.2

License

MIT

Last publish

Collaborators

  • mikkoh