diff --git a/assets/sass/config/_mixins.scss b/assets/sass/config/_mixins.scss index c410d12..cb5ecaf 100755 --- a/assets/sass/config/_mixins.scss +++ b/assets/sass/config/_mixins.scss @@ -58,3 +58,26 @@ clear: both; } } + + + +/** + * Positioning + */ + +@mixin center($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%); + } +}