Visibility

Utilities for controlling the visibility of an element.

On this page
ClassProperties
.visiblevisibility: visible;
.invisiblevisibility: hidden;

Usage

Use .visible to make an element visible.

<div class="flex justify-content-center">
  <div class="bg-subtle"></div>
  <div class="bg-brand visible text-brand-inverse"></div>
  <div class="bg-brand text-brand-inverse"></div>
</div>

Use .invisible to hide an element while still affecting the layout of other elements.

<div class="flex justify-content-center">
  <div class="bg-subtle"></div>
  <div class="bg-brand invisible text-brand-inverse"></div>
  <div class="bg-brand text-brand-inverse"></div>
</div>

Variants

By default, only responsive variants are generated for visibility utilities.

Responsive

To control the position of an element at a specific breakpoint, add a {screen}: prefix to any existing visibility utility.

For example, use .md:invisible to apply the invisible utility at only medium screen sizes and above.

Hover-state

To include hover-state variants like .hover:invisible, add "visibility" to the $hover-variants variable when recompiling your CSS:

$hover-variants: (
  // ...
  "visibility",
);

Questions or feedback about this article? Let us know