/* ------------------------------------------------------------------------ *\
   mixins.typography.font
\* ------------------------------------------------------------------------ */


/**
 * [font description]
 * @param  {[type]} family [description]
 * @param  {[type]} size   [description]
 * @param  {[type]} style  =             normal [description]
 * @param  {[type]} weight =             normal [description]
 * @return {[type]}        [description]
 */
t-font(family, size, style = normal, weight = normal)
  font-family: family, nix.text.family.default
  font-style: style
  font-weight: weight
  font-size: size


/**
 * [face description]
 * @param  {[type]} name   [description]
 * @param  {[type]} weight =             "normal" [description]
 * @param  {[type]} style  =             "normal" [description]
 * @return {[type]}        [description]
 */
t-font--face(family, name, weight = "normal", style = "normal")
  url-fallback = "url('" + nix.fonts.path + "/" + name + ".eot')"
  url = "url('" + nix.fonts.path + "/" + name + ".eot?#iefix') format('embedded-opentype'), "
  url = url + "url('" + nix.fonts.path + "/" + name + ".woff') format('woff'), "
  url = url + "url('" + nix.fonts.path + "/" + name + ".ttf') format('truetype'), "
  url = url + "url('" + nix.fonts.path + "/" + name + ".svg#svg" + name + "') format('svg')"

  @font-face
    src: unquote(url-fallback)
    src: unquote(url)
    font-family: family
    font-style: unquote(style)
    font-weight: unquote(weight)


/**
 * [family description]
 * @param  {[type]} family [description]
 * @return {[type]}        [description]
 */
t-font--family(family)
  font-family: family, nix.text.family.default


/**
 * [size description]
 * @param  {[type]} size [description]
 * @return {[type]}      [description]
 */
t-font--size(size)
  font-size: size


/**
 * [smoothing description]
 * @param  {[type]} value =             true [description]
 * @return {[type]}       [description]
 */
t-font--smoothing(value = true)
  if value
    -webkit-font-smoothing: antialiased
    -moz-osx-font-smoothing: grayscale
  else
    -webkit-font-smoothing: subpixel-antialiased
    -moz-osx-font-smoothing: auto


/**
 * [base description]
 * @param  {[type]} type [description]
 * @return {[type]}      [description]
 */
t-font--base(type)
  t-font--smoothing(type.smoothing)
  font-size: type.size
  font-weight: type.weight
  font-family: type.family
  line-height: type.line-height
  -ms-text-size-adjust: 100%
  -webkit-text-size-adjust: 100%
  -webkit-tap-highlight-color: rgba(128, 203, 196, .1)
