1.0.2 • Published 9 years ago
cssobject-from-selector v1.0.2
cssobject-from-selector
Pass an object defining css a function will be returned. Pass selectors to the returned function to get merged css objects
Usage
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.