@mixin centered { text-align: center; } @mixin center-block { position: relative; } @mixin center-block__content { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); } @mixin center-block__content--vertical { transform: translateY(-50%); left: auto; } @mixin center-block__content--horizontal { transform: translateX(-50%); top: auto; }