// Hidden
// ======

/// # Accessibility
///
/// A simple set of utilities
/// for handling text-visibility
/// and screen-reader accessibility
/// across your site.
///
/// @group type-a11y

// Is Hidden
// ---------
/// Hide an element using either the `clip` or `position` method.
/// @group type-a11y
/// @param {'clip' | 'position'} $method ['clip'] -
///   The hiding method to use.
@mixin is-hidden($method: 'clip') {
  @if $method == 'position' {
    @include _is-hidden-position;
  } @else {
    @include _is-hidden-clip;
  }
}

// Is Hidden -- Position
// ---------------------
/// Hide an element by positioning it off the page.
/// @group type-a11y
/// @access private
@mixin _is-hidden-position {
  left: -9999px;
  pointer-events: none;
  position: absolute;
  top: -9999px;
}

// Is Hidden -- Clip
// -----------------
/// Hide an element by clipping it in place.
/// @group type-a11y
/// @access private
@mixin _is-hidden-clip {
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(1px 1px 1px 1px);
  height: 1px;
  overflow: hidden;
  pointer-events: none;
  position: absolute;
  width: 1px;
}
