Utilities
Visibility
Control the visibility of elements, without modifying their display, with visibility utilities.
How it works
Set the visibility of elements with our visibility utilities. These utility classes do not
modify the display value at all and do not affect layout — .invisible elements
still take up space in the page.
.invisible class will be hidden both visually and for assistive
technology/screen reader users.Apply .visible or .invisible as needed.
HTML
<div class="d-flex gap-3">
<div class="p-3 text-bg-navy rounded">visible</div>
<div class="invisible p-3 text-bg-navy rounded">invisible — still reserves this space</div>
<div class="p-3 text-bg-navy rounded">visible</div>
</div><div class="visible">...</div>
<div class="invisible">...</div>
// Class
.visible {
visibility: visible !important;
}
.invisible {
visibility: hidden !important;
}
Which hiding class?
Four ways to hide something, and they are not interchangeable:
| Class | Takes space | Visible | Read by screen readers | Page |
|---|---|---|---|---|
.d-none | No | No | No | Display |
.invisible | Yes | No | No | this page |
.opacity-0 | Yes | No | Yes (and focusable) | Opacity |
.visually-hidden | No | No | Yes | Visually hidden |
.invisible is the right choice when a layout must not shift — a "Sold out" tag that appears
later, a placeholder for an icon that is sometimes absent, or the second button in a pair that should keep
the first one from moving.
In this theme
The no-JS components never toggle .invisible on your behalf; they rely on the native
hidden state of <details>, <dialog> and
popover. Use these utilities for static layout decisions only. For a hover-reveal, pair
.invisible with your own :hover rule and the
.transition-fade utility (see Options for the motion
tokens):
.card .edit-btn { visibility: hidden; opacity: 0; }
.card:hover .edit-btn,
.card:focus-within .edit-btn { visibility: visible; opacity: 1; }
CSS
"visibility": (
property: visibility,
class: null,
values: (
visible: visible,
invisible: hidden,
)
),