/* ------------------------------------------------------------------------ *\
   mixins.util.border
\* ------------------------------------------------------------------------ */


/**
 * [radius description]
 * @param  {[type]} radius [description]
 * @return {[type]}        [description]
 */
u-border--radius(radius)
  border-radius: radius


/**
 * [color description]
 * @return {[type]} [description]
 */
u-border--color()
  if null in arguments
    border-top-color:      arguments[0] if arguments[0] != null
    border-right-color:    arguments[1] if arguments[1] != null
    if length(arguments)      == 2
      border-bottom-color: arguments[0] if arguments[0] != null
      border-left-color:   arguments[1] if arguments[1] != null
    else if length(arguments) == 3
      border-bottom-color: arguments[2] if arguments[2] != null
      border-left-color:   arguments[1] if arguments[1] != null
    else if length(arguments) == 4
      border-bottom-color: arguments[2] if arguments[2] != null
      border-left-color:   arguments[3] if arguments[3] != null
  else
    border-color: arguments


/**
 * [width description]
 * @return {[type]} [description]
 */
u-border--width()
  if null in arguments
    border-top-width:      arguments[0] if arguments[0] != null
    border-right-width:    arguments[1] if arguments[1] != null
    if length(arguments)      == 2
      border-bottom-width: arguments[0] if arguments[0] != null
      border-left-width:   arguments[1] if arguments[1] != null
    else if length(arguments) == 3
      border-bottom-width: arguments[2] if arguments[2] != null
      border-left-width:   arguments[1] if arguments[1] != null
    else if length(arguments) == 4
      border-bottom-width: arguments[2] if arguments[2] != null
      border-left-width:   arguments[3] if arguments[3] != null
  else
    border-width: arguments


/**
 * [style description]
 * @return {[type]} [description]
 */
u-border--style()
  if null in arguments
    border-top-style:      arguments[0] if arguments[0] != null
    border-right-style:    arguments[1] if arguments[1] != null
    if length(arguments)      == 2
      border-bottom-style: arguments[0] if arguments[0] != null
      border-left-style:   arguments[1] if arguments[1] != null
    else if length(arguments) == 3
      border-bottom-style: arguments[2] if arguments[2] != null
      border-left-style:   arguments[1] if arguments[1] != null
    else if length(arguments) == 4
      border-bottom-style: arguments[2] if arguments[2] != null
      border-left-style:   arguments[3] if arguments[3] != null
  else
    border-style: arguments


/**
 * [border description]
 * @param  {[type]} direction =             "all" [description]
 * @param  {[type]} size      [description]
 * @param  {[type]} style     =             solid [description]
 * @param  {[type]} radius    =             none  [description]
 * @return {[type]}           [description]
 */
u-border(direction = "all", size, style = solid, radius = none)
  u-border--radius(radius)

  border-style: style

  if direction == "all"
    border-width: size

  else if direction == "vertical"
    border-top-width: size
    border-bottom-width: size

  else if direction == "horizontal"
    border-right-width: size
    border-left-width: size

  else if direction == "top"
    border-top-width: size

  else if direction == "right"
    border-right-width: size

  else if direction == "bottom"
    border-bottom-width: size

  else
    border-left-width: size


// /**
//  * automatic mixins generation
//  * u-border--{direction}(size, style)
//  * u-border--{direction}--{size}(style)
//  */
// for dk, dv in nix.directions
//   u-border--{dk}(size, style)
//     u-border(dk, size, style)
//
//   for sk, sv in nix.sizes
//     u-border--{dk}--{sk}(style)
//       u-border(dk, sv, style, radius)


/**
 * [top description]
 * @param  {[type]} size [description]
 * @return {[type]}      [description]
 */
u-border--top(size, style = solid)
  border-top: size + " " + style


/**
 * [xxxl description]
 * @return {[type]} [description]
 */
u-border--top--xxxl(style = solid)
  border-top: nix.sizes.xxxl + " " + style


/**
 * [xxl description]
 * @return {[type]} [description]
 */
u-border--top--xxl(style = solid)
  border-top: nix.sizes.xxl + " " + style


/**
 * [xl description]
 * @return {[type]} [description]
 */
u-border--top--xl(style = solid)
  border-top: nix.sizes.xl + " " + style


/**
 * [lg description]
 * @return {[type]} [description]
 */
u-border--top--lg(style = solid)
  border-top: nix.sizes.lg + " " + style


/**
 * [md description]
 * @return {[type]} [description]
 */
u-border--top--md(style = solid)
  border-top: nix.sizes.md + " " + style


/**
 * [sm description]
 * @return {[type]} [description]
 */
u-border--top--sm(style = solid)
  border-top: nix.sizes.sm + " " + style


/**
 * [xs description]
 * @return {[type]} [description]
 */
u-border--top--xs(style = solid)
  border-top: nix.sizes.xs + " " + style


/**
 * [xxs description]
 * @return {[type]} [description]
 */
u-border--top--xxs()
  border-top: nix.sizes.xxs + " " + style


/**
 * [xxxs description]
 * @return {[type]} [description]
 */
u-border--top--xxxs()
  border-top: nix.sizes.xxxs + " " + style


/**
 * [right description]
 * @param  {[type]} size [description]
 * @return {[type]}      [description]
 */
u-border--right(size, style = solid)
  border-right: size + " " + style


/**
 * [xxxl description]
 * @return {[type]} [description]
 */
u-border--right--xxxl(style = solid)
  border-right: nix.sizes.xxxl + " " + style


/**
 * [xxl description]
 * @return {[type]} [description]
 */
u-border--right--xxl(style = solid)
  border-right: nix.sizes.xxl + " " + style


/**
 * [xl description]
 * @return {[type]} [description]
 */
u-border--right--xl(style = solid)
  border-right: nix.sizes.xl + " " + style


/**
 * [lg description]
 * @return {[type]} [description]
 */
u-border--right--lg(style = solid)
  border-right: nix.sizes.lg + " " + style


/**
 * [md description]
 * @return {[type]} [description]
 */
u-border--right--md(style = solid)
  border-right: nix.sizes.md + " " + style


/**
 * [sm description]
 * @return {[type]} [description]
 */
u-border--right--sm(style = solid)
  border-right: nix.sizes.sm + " " + style


/**
 * [xs description]
 * @return {[type]} [description]
 */
u-border--right--xs(style = solid)
  border-right: nix.sizes.xs + " " + style


/**
 * [xxs description]
 * @return {[type]} [description]
 */
u-border--right--xxs(style = solid)
  border-right: nix.sizes.xxs + " " + style


/**
 * [xxxs description]
 * @return {[type]} [description]
 */
u-border--right--xxxs(style = solid)
  border-right: nix.sizes.xxxs + " " + style


/**
 * [bottom description]
 * @param  {[type]} size [description]
 * @return {[type]}      [description]
 */
u-border--bottom(size, style = solid)
  border-bottom: size + " " + style


/**
 * [xxxl description]
 * @return {[type]} [description]
 */
u-border--bottom--xxxl(style = solid)
  border-bottom: nix.sizes.xxxl + " " + style


/**
 * [xxl description]
 * @return {[type]} [description]
 */
u-border--bottom--xxl(style = solid)
  border-bottom: nix.sizes.xxl + " " + style


/**
 * [xl description]
 * @return {[type]} [description]
 */
u-border--bottom--xl(style = solid)
  border-bottom: nix.sizes.xl + " " + style


/**
 * [lg description]
 * @return {[type]} [description]
 */
u-border--bottom--lg()
  border-bottom: nix.sizes.lg + " " + style


/**
 * [md description]
 * @return {[type]} [description]
 */
u-border--bottom--md(style = solid)
  border-bottom: nix.sizes.md + " " + style


/**
 * [sm description]
 * @return {[type]} [description]
 */
u-border--bottom--sm()
  border-bottom: nix.sizes.sm + " " + style


/**
 * [xs description]
 * @return {[type]} [description]
 */
u-border--bottom--xs()
  border-bottom: nix.sizes.xs + " " + style


/**
 * [xxs description]
 * @return {[type]} [description]
 */
u-border--bottom--xxs()
  border-bottom: nix.sizes.xxs + " " + style


/**
 * [xxxs description]
 * @return {[type]} [description]
 */
u-border--bottom--xxxs()
  border-bottom: nix.sizes.xxxs + " " + style


/**
 * [left description]
 * @param  {[type]} size [description]
 * @return {[type]}      [description]
 */
u-border--left(size, style)
  border-left: size + " " + style


/**
 * [xxxl description]
 * @return {[type]} [description]
 */
u-border--left--xxxl(style = solid)
  border-left: nix.sizes.xxxl + " " + style


/**
 * [xxl description]
 * @return {[type]} [description]
 */
u-border--left--xxl(style = solid)
  border-left: nix.sizes.xxl + " " + style


/**
 * [xl description]
 * @return {[type]} [description]
 */
u-border--left--xl(style = solid)
  border-left: nix.sizes.xl + " " + style


/**
 * [lg description]
 * @return {[type]} [description]
 */
u-border--left--lg(style = solid)
  border-left: nix.sizes.lg + " " + style


/**
 * [md description]
 * @return {[type]} [description]
 */
u-border--left--md(style = solid)
  border-left: nix.sizes.md + " " + style


/**
 * [sm description]
 * @return {[type]} [description]
 */
u-border--left--sm(style = solid)
  border-left: nix.sizes.sm + " " + style


/**
 * [xs description]
 * @return {[type]} [description]
 */
u-border--left--xs(style = solid)
  border-left: nix.sizes.xs + " " + style


/**
 * [xxs description]
 * @return {[type]} [description]
 */
u-border--left--xxs(style = solid)
  border-left: nix.sizes.xxs + " " + style


/**
 * [xxxs description]
 * @return {[type]} [description]
 */
u-border--left--xxxs(style = solid)
  border-left: nix.sizes.xxxs + " " + style


/**
 * [vertical description]
 * @param  {[type]} size [description]
 * @return {[type]}      [description]
 */
u-border--vertical(size, style = solid)
  u-border--top(size)
  u-border--bottom(size)


/**
 * [xxxl description]
 * @return {[type]} [description]
 */
u-border--vertical--xxxl()
  u-border--top--xxxl()
  u-border--bottom--xxxl()


/**
 * [xxl description]
 * @return {[type]} [description]
 */
u-border--vertical--xxl()
  u-border--top--xxl()
  u-border--bottom--xxl()


/**
 * [xl description]
 * @return {[type]} [description]
 */
u-border--vertical--xl()
  u-border--top--xl()
  u-border--bottom--xl()


/**
 * [lg description]
 * @return {[type]} [description]
 */
u-border--vertical--lg()
  u-border--top--lg()
  u-border--bottom--lg()


/**
 * [md description]
 * @return {[type]} [description]
 */
u-border--vertical--md()
  u-border--top--md()
  u-border--bottom--md()


/**
 * [sm description]
 * @return {[type]} [description]
 */
u-border--vertical--sm()
  u-border--top--sm()
  u-border--bottom--sm()


/**
 * [xs description]
 * @return {[type]} [description]
 */
u-border--vertical--xs()
  u-border--top--xs()
  u-border--bottom--xs()


/**
 * [xxs description]
 * @return {[type]} [description]
 */
u-border--vertical--xxs()
  u-border--top--xxs()
  u-border--bottom--xxs()


/**
 * [xxxs description]
 * @return {[type]} [description]
 */
u-border--vertical--xxxs()
  u-border--top--xxxs()
  u-border--bottom--xxxs()


/**
 * [horizontal description]
 * @param  {[type]} size [description]
 * @return {[type]}      [description]
 */
u-border--horizontal(size, style = solid)
  u-border--right(size)
  u-border--left(size)


/**
 * [xxxl description]
 * @return {[type]} [description]
 */
u-border--horizontal--xxxl()
  u-border--right--xxxl()
  u-border--left--xxxl()


/**
 * [xxl description]
 * @return {[type]} [description]
 */
u-border--horizontal--xxl()
  u-border--right--xxl()
  u-border--left--xxl()


/**
 * [xl description]
 * @return {[type]} [description]
 */
u-border--horizontal--xl()
  u-border--right--xl()
  u-border--left--xl()


/**
 * [lg description]
 * @return {[type]} [description]
 */
u-border--horizontal--lg()
  u-border--right--lg()
  u-border--left--lg()


/**
 * [md description]
 * @return {[type]} [description]
 */
u-border--horizontal--md()
  u-border--right--md()
  u-border--left--md()


/**
 * [sm description]
 * @return {[type]} [description]
 */
u-border--horizontal--sm()
  u-border--right--sm()
  u-border--left--sm()


/**
 * [xs description]
 * @return {[type]} [description]
 */
u-border--horizontal--xs()
  u-border--right--xs()
  u-border--left--xs()


/**
 * [xxs description]
 * @return {[type]} [description]
 */
u-border--horizontal--xxs()
  u-border--right--xxs()
  u-border--left--xxs()


/**
 * [xxxs description]
 * @return {[type]} [description]
 */
u-border--horizontal--xxxs()
  u-border--right--xxxs()
  u-border--left--xxxs()


/**
 * [all description]
 * @param  {[type]} size [description]
 * @return {[type]}      [description]
 */
u-border--all(size)
  u-border--vertical(size)
  u-border--horizontal(size)


/**
 * [xxxl description]
 * @return {[type]} [description]
 */
u-border--all--xxxl()
  u-border--vertical--xxxl()
  u-border--horizontal--xxxl()


/**
 * [xxl description]
 * @return {[type]} [description]
 */
u-border--all--xxl()
  u-border--vertical--xxl()
  u-border--horizontal--xxl()


/**
 * [xl description]
 * @return {[type]} [description]
 */
u-border--all--xl()
  u-border--vertical--xl()
  u-border--horizontal--xl()


/**
 * [lg description]
 * @return {[type]} [description]
 */
u-border--all--lg()
  u-border--vertical--lg()
  u-border--horizontal--lg()


/**
 * [md description]
 * @return {[type]} [description]
 */
u-border--all--md()
  u-border--vertical--md()
  u-border--horizontal--md()


/**
 * [sm description]
 * @return {[type]} [description]
 */
u-border--all--sm()
  u-border--vertical--sm()
  u-border--horizontal--sm()


/**
 * [xs description]
 * @return {[type]} [description]
 */
u-border--all--xs()
  u-border--vertical--xs()
  u-border--horizontal--xs()


/**
 * [xxs description]
 * @return {[type]} [description]
 */
u-border--all--xxs()
  u-border--vertical--xxs()
  u-border--horizontal--xxs()


/**
 * [xxxs description]
 * @return {[type]} [description]
 */
u-border--all--xxxs()
  u-borderr--vertical--xxxs()
  u-border--horizontal--xxxs()


/**
 * [create description]
 * @param  {[type]} selector [description]
 * @return {[type]}          [description]
 */
u-border--create(selector)
  for dk, dv in nix.directions
    for sk, sv in nix.sizes
      [{selector}~=\"--{dv}--{sk}\"]
        u-border(dk, sv)
