uxebu / the-style-machine

JS-based style sheet creation for nodes and browsers
ISC License
0 stars 0 forks source link

Definition of styles per component #4

Open nerdbeere opened 9 years ago

nerdbeere commented 9 years ago

Are there any plans yet how styles are going to be defined? When I first thought about how to express css in javascript I had something like this in mind:

var style = {
    '.my-class': {
        'background': '#FF0000',
        '&:hover': {
            'color': '#333333'
        },
        '&.hide': {
            'display': 'none'
        }
    }
}

But I'm not sure that I like this idea, my concerns are:

klipstein commented 9 years ago

I think you don't want to assign any class names. They are generated for you.

basecode commented 9 years ago

As I understand it, that's one of the great benefits of that approach letting the computer add "namespaced class names". Humans can't handle class names :)