Skip to content

Instantly share code, notes, and snippets.

@CreativeSeo33
Created September 3, 2015 11:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CreativeSeo33/fd933dac9c0b8ec89e1b to your computer and use it in GitHub Desktop.
Save CreativeSeo33/fd933dac9c0b8ec89e1b to your computer and use it in GitHub Desktop.
mixin centerer
@mixin centerer($horizontal: true, $vertical: true) {
position: absolute;
@if ($horizontal and $vertical) {
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
} @else if ($horizontal) {
left: 50%;
transform: translate(-50%, 0);
} @else if ($vertical) {
top: 50%;
transform: translate(0, -50%);
}
}
@CreativeSeo33
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment