Last Updated: February 25, 2016
·
662
· dwayne

Vertically center anything

// Assumes Bourbon - See http://bourbon.io/docs/#transform
// To see it in action, check out http://codepen.io/dwayne/pen/gjDGx

@mixin vertical-center {
  position: relative;
  top: 50%;
  @include transform(translateY(-50%));
}

Thanks to @DenzilDoyle for showing me this.