/// Centers a selector's content horizontally, vertically, or both.
///
/// @group Layout
/// @author Kendrick Arnett
///
/// @see {mixin} centered-horizontally
/// @see {mixin} centered-vertically
///
/// @param $horizontal [false] - Indicates whether to center horizontally.
/// @param $vertical [false] - Indicates whether to center vertically.
@mixin centered($horizontal: false, $vertical: false) {
  position: absolute;
  @if ($horizontal and $vertical) or (not $horizontal and not $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%);
  }
}

/// A shorthand method to center a selector's content horizontally.
///
/// @group Layout
/// @author Kendrick Arnett
///
/// @see {mixin} centered
@mixin centered-horizontally() {
  @include centered($horizontal: true);
}

/// A shorthand method to center a selector's content vertically.
///
/// @group Layout
/// @author Kendrick Arnett
///
/// @see {mixin} centered
@mixin centered-vertically() {
  @include centered($vertical: true);
}
