lib/border-radius.js
function flipCorners(value) {
  var elements = value.split(/\s+/);

  if (!elements) { return value; }

  switch (elements.length) {
    // 5px 10px 15px 20px => 10px 5px 20px 15px
    case 4: return [elements[1], elements[0], elements[3], elements[2]].join(' ');

    // 5px 10px 20px => 10px 5px 10px 20px
    case 3: return [elements[1], elements[0], elements[1], elements[2]].join(' ');

    // 5px 10px => 10px 5px
    case 2: return [elements[1], elements[0]].join(' ');
  }

  return value;
}
function flipCorners(value) {
  var elements = value.split(/\s+/);

  if (!elements) { return value; }

  switch (elements.length) {
    // 5px 10px 15px 20px => 10px 5px 20px 15px
    case 4: return [elements[1], elements[0], elements[3], elements[2]].join(' ');

    // 5px 10px 20px => 10px 5px 10px 20px
    case 3: return [elements[1], elements[0], elements[1], elements[2]].join(' ');

    // 5px 10px => 10px 5px
    case 2: return [elements[1], elements[0]].join(' ');
  }

  return value;
}
function flipCorners ( value ) { var elements = value . split ( / \s+ / ) ; if ( ! elements ) { return value ; } switch ( elements . length ) { // 5px 10px 15px 20px => 10px 5px 20px 15px case 4 : return [ elements [ 1 ] , elements [ 0 ] , elements [ 3 ] , elements [ 2 ] ] . join ( ' ' ) ; // 5px 10px 20px => 10px 5px 10px 20px case 3 : return [ elements [ 1 ] , elements [ 0 ] , elements [ 1 ] , elements [ 2 ] ] . join ( ' ' ) ; // 5px 10px => 10px 5px case 2 : return [ elements [ 1 ] , elements [ 0 ] ] . join ( ' ' ) ; } return value ; }
Flip the corners of a `border-radius` value.

@param {String} value Value
@return {String}
Flip the corners of a border - radius value .