Skip to content

Experience-Monks/cssobject-from-selector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published