Sha256: fffa0ece725d6ee1a3c5611b31d1ab332b3122ceb6635bf29c46312e37c154c3

Contents?: true

Size: 1.7 KB

Versions: 17

Compression:

Stored size: 1.7 KB

Contents

@charset "UTF-8";

/// Hides an element visually while still allowing the content to be accessible
/// to assistive technology, e.g. screen readers. Passing `unhide` will reverse
/// the affects of the hiding, which is handy for showing the element on focus,
/// for example.
///
/// @link https://goo.gl/Vf1TGn
///
/// @argument {string} $toggle [hide]
///   Accepts `hide` or `unhide`. `unhide` reverses the affects of `hide`.
///
/// @example scss
///   .element {
///     @include hide-visually;
///
///     &:active,
///     &:focus {
///       @include hide-visually("unhide");
///     }
///   }
///
///   // CSS Output
///   .element {
///     border: 0;
///     clip: rect(1px, 1px, 1px, 1px);
///     clip-path: inset(100%);
///     height: 1px;
///     overflow: hidden;
///     padding: 0;
///     position: absolute;
///     width: 1px;
///   }
///
///   .hide-visually:active,
///   .hide-visually:focus {
///     clip: auto;
///     clip-path: none;
///     height: auto;
///     overflow: visible;
///     position: static;
///     width: auto;
///   }
///
/// @since 5.0.0

@mixin hide-visually($toggle: "hide") {
  @if not index("hide" "unhide", $toggle) {
    @error "`#{$toggle}` is not a valid value for the `$toggle` argument in " +
      "the `hide-visually` mixin. Must be either `hide` or `unhide`.";
  } @else if $toggle == "hide" {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(100%);
    height: 1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    white-space: nowrap;
    width: 1px;
  } @else if $toggle == "unhide" {
    clip: auto;
    clip-path: none;
    height: auto;
    overflow: visible;
    position: static;
    white-space: inherit;
    width: auto;
  }
}

Version data entries

17 entries across 17 versions & 3 rubygems

Version Path
baseline-scss-0.5.0 src/vendors/bourbon/library/_hide-visually.scss
baseline-scss-0.4.4 src/vendors/bourbon/library/_hide-visually.scss
baseline-scss-0.4.3 src/vendors/bourbon/library/_hide-visually.scss
baseline-scss-0.4.2 src/vendors/bourbon/library/_hide-visually.scss
baseline-scss-0.4.1 src/vendors/bourbon/library/_hide-visually.scss
baseline-scss-0.4.0 src/vendors/bourbon/library/_hide-visually.scss
baseline-scss-0.3.3 src/vendors/bourbon/library/_hide-visually.scss
baseline-scss-0.3.2 src/vendors/bourbon/library/_hide-visually.scss
baseline-scss-0.3.1 src/vendors/bourbon/library/_hide-visually.scss
baseline-scss-0.3.0 src/vendors/bourbon/library/_hide-visually.scss
bourbon-7.3.0 core/bourbon/library/_hide-visually.scss
bourbon-7.2.0 core/bourbon/library/_hide-visually.scss
bourbon-7.1.0 core/bourbon/library/_hide-visually.scss
geekspace-3.2.0 _sass/bourbon/bourbon/library/_hide-visually.scss
geekspace-3.1.2 _sass/bourbon/bourbon/library/_hide-visually.scss
geekspace-3.1.1 _sass/bourbon/bourbon/library/_hide-visually.scss
bourbon-7.0.0 core/bourbon/library/_hide-visually.scss