lib/api/css.js
function setCss(el, prop, val, idx) {
  if ('string' == typeof prop) {
    var styles = getCss(el);
    if (typeof val === 'function') {
      val = val.call(el, idx, styles[prop]);
    }

    if (val === '') {
      delete styles[prop];
    } else if (val != null) {
      styles[prop] = val;
    }

    el.attribs.style = stringify(styles);
  } else if ('object' == typeof prop) {
    Object.keys(prop).forEach(function(k){
      setCss(el, k, prop[k]);
    });
  }
}
function setCss(el, prop, val, idx) {
  if ('string' == typeof prop) {
    var styles = getCss(el);
    if (typeof val === 'function') {
      val = val.call(el, idx, styles[prop]);
    }

    if (val === '') {
      delete styles[prop];
    } else if (val != null) {
      styles[prop] = val;
    }

    el.attribs.style = stringify(styles);
  } else if ('object' == typeof prop) {
    Object.keys(prop).forEach(function(k){
      setCss(el, k, prop[k]);
    });
  }
}
function setCss ( el , prop , val , idx ) { if ( 'string' == typeof prop ) { var styles = getCss ( el ) ; if ( typeof val === 'function' ) { val = val . call ( el , idx , styles [ prop ] ) ; } if ( val === '' ) { delete styles [ prop ] ; } else if ( val != null ) { styles [ prop ] = val ; } el . attribs . style = stringify ( styles ) ; } else if ( 'object' == typeof prop ) { Object . keys ( prop ) . forEach ( function ( k ) { setCss ( el , k , prop [ k ] ) ; } ) ; } }
Set styles of all elements.

@param {String|Object} prop
@param {String} val
@param {Number} idx - optional index within the selection
@return {self}
@api private
Set styles of all elements .