src/console/simpleyui.js
function(node, att, val, style) {
        style = style || node.style;
        var CUSTOM_STYLES = Y_DOM.CUSTOM_STYLES,
            current;

        if (style) {
            if (val === null || val === '') { // normalize unsetting
                val = '';
            } else if (!isNaN(new Number(val)) && re_unit.test(att)) { // number values may need a unit
                val += Y_DOM.DEFAULT_UNIT;
            }

            if (att in CUSTOM_STYLES) {
                if (CUSTOM_STYLES[att].set) {
                    CUSTOM_STYLES[att].set(node, val, style);
                    return; // NOTE: return
                } else if (typeof CUSTOM_STYLES[att] === 'string') {
                    att = CUSTOM_STYLES[att];
                }
            }
            style[att] = val; 
        }
    }
function(node, att, val, style) {
        style = style || node.style;
        var CUSTOM_STYLES = Y_DOM.CUSTOM_STYLES,
            current;

        if (style) {
            if (val === null || val === '') { // normalize unsetting
                val = '';
            } else if (!isNaN(new Number(val)) && re_unit.test(att)) { // number values may need a unit
                val += Y_DOM.DEFAULT_UNIT;
            }

            if (att in CUSTOM_STYLES) {
                if (CUSTOM_STYLES[att].set) {
                    CUSTOM_STYLES[att].set(node, val, style);
                    return; // NOTE: return
                } else if (typeof CUSTOM_STYLES[att] === 'string') {
                    att = CUSTOM_STYLES[att];
                }
            }
            style[att] = val; 
        }
    }
function ( node , att , val , style ) { style = style || node . style ; var CUSTOM_STYLES = Y_DOM . CUSTOM_STYLES , current ; if ( style ) { if ( val === null || val === '' ) { // normalize unsetting val = '' ; } else if ( ! isNaN ( new Number ( val ) ) && re_unit . test ( att ) ) { // number values may need a unit val += Y_DOM . DEFAULT_UNIT ; } if ( att in CUSTOM_STYLES ) { if ( CUSTOM_STYLES [ att ] . set ) { CUSTOM_STYLES [ att ] . set ( node , val , style ) ; return ; // NOTE: return } else if ( typeof CUSTOM_STYLES [ att ] === 'string' ) { att = CUSTOM_STYLES [ att ] ; } } style [ att ] = val ; } }
Sets a style property for a given element.
@method setStyle
@param {HTMLElement} An HTMLElement to apply the style to.
@param {String} att The style property to set.
@param {String|Number} val The value.
Sets a style property for a given element .