// Stylus doesn't have sqrt wtf m8
sqrt(x)
  return math(x, 'sqrt')


// Calculates a golden-ratio derived line-height given font-size and content width
golden($f, $w)
  $phi = ((1 + sqrt(5)) / 2) * 1em
  return $phi - (1 / (2 * $phi)) * (1 - ($w / (($f * $phi) * ($f * $phi) / 1px)))

// Only use this mixin for non-interactable icons
// For interactable icons (buttons etc.) use <i class="bzicon-[ICON_NAME]"></i>
// Refer to assets/styles/global/layout for icon codes
icon()
  font-family "bzpro-icons"
  font-weight normal
  speak none
  font-variant normal
  text-transform none

placeholderColor(c)
  &::-webkit-input-placeholder
    color c
  // Firefox 18-
  &:-moz-placeholder
    color c
  // Firefox 19+
  &::-moz-placeholder
    color c
  &:-ms-input-placeholder
    color c

simpleTransition(property = all, duration = .2s, easetype = ease)
  transition property duration easetype

noSelect()
  -webkit-user-select none
  -moz-user-select none
  -ms-user-select none
  user-select none

backgroundFallback(bitmap, svg, x = center, y = center, repeat = no-repeat)
  background: bitmap x y repeat
  background: none, svg x y repeat

// clearfix() is already included with . Dope, eh?
// However, just use flex for most cases - otherwise just inline-block it.
// Just remember: only YOU can prevent float fuckery.
// clearfix()
//   zoom 1
//   &:after
//   &:before
//     content ""
//     display table
//   &:after
//     clear both

coverScreen(pos)
  position pos
  left 0
  top 0
  right 0
  bottom 0

boxShadow()
  box-shadow 0 0 10px rgba(lightness($bz-black, 9%) 0.1)

multilineEllipsis(fontSize, lineHeight, lines)
  display block
  display -webkit-box
  max-height fontSize*lineHeight*lines
  font-size fontSize
  line-height lineHeight
  -webkit-line-clamp lines
  -webkit-box-orient vertical
  overflow hidden
  text-overflow ellipsis
