jquery-archive / css-chassis

An attempt at creating an open standard for both CSS and JavaScript UI libraries.
https://css-chassis.com
Other
351 stars 67 forks source link

Build: heirarchial prefixer for scss variable files #111

Closed geekman-rohit closed 8 years ago

geekman-rohit commented 8 years ago

This file will help with prefixing for jsass-vars variable files. It also allows heirarchial prefixing, allowing us to create strucuture in variable files. eg.

chassis.meter = {
    'ui-meter-height': { 
        name: ' Meter Height',
        value: '24px' 
    },
    'ui-meter-width': {
         name: 'Meter Width',
         value: '200px' 
    },
    'ui-meter-border-radius': {
         name: 'Meter Border Radius',
         value: 0 
    },
    'ui-meter-border-size': {
         name: 'Meter Border Size',
         value: '1px' 
    },
    'ui-meter-border-color': {
         name: 'Meter Border Color',
         value: '$color-gray-dark' 
    } 
}

Using this module we could do :

var meter = {
ui: {
        meter: {
            height: {
                name: " Meter Height",
                value: "24px"
            },
            width: {
                name:"Meter Width",
                value:"200px"
            },
            border:{
                radius: {
                    name: "Meter Border Radius",
                    value: 0
                },
                size: {
                    name: "Meter Border Size",
                    value: "1px"
                },
                color: {
                    name: "Meter Border Color",
                    value: "$color-gray-dark"
                }
            }
        }
    }
}
chassis.meter =  prefixer( meter );

We could include it if it could be helpful.

geekman-rohit commented 8 years ago

@sfrisk did you get a chance to try this?

sfrisk commented 8 years ago

Closing this, since most variable work so far doesn't use this, and variables should be readable enough if we keep them short.