Skip to content

Instantly share code, notes, and snippets.

@uglyeoin
Created December 10, 2018 19:57
Show Gist options
  • Save uglyeoin/8a5f641fb883f77d56020bb5c6860ff7 to your computer and use it in GitHub Desktop.
Save uglyeoin/8a5f641fb883f77d56020bb5c6860ff7 to your computer and use it in GitHub Desktop.
@mixin vertical-align($position: relative) {
position: $position;
top: 50%;
-webkit-transform: translateY(-50%);
-ms-transform: translateY(-50%);
transform: perspective(1px) translateY(-50%);
}
/* Example Usage
.element p {
@include vertical-align();
}
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment