Modal + snackbar

The two surface primitives for overlay content: modal mixins (used by search, dropdowns, the shortcuts panel) and snackbar toasts.

≈ 2 min read 300 words Updated 2026-11-20

On this page

Two low-level surfaces Bifrost uses across multiple feature components.

_modal.scss exposes mixins rather than a finished component. Concrete modals (search overlay, navbar dropdowns, share/login panels) @include the mixins to inherit consistent open/close transitions and backdrop treatment.

Source: themes/bifrost/sass/components/_modal.scss

MixinSets
modal-baseopacity: 0 / visibility: hidden defaults, --active state.
modal-backdropFixed full-screen backdrop, var(--color-overlay), backdrop-filter: blur(8px).
.search-modal {
    @include modal-base;
    …
    &__backdrop { @include modal-backdrop; }
}

Snackbar#

.snackbar is the receipt for a small action — “Added to reading list”, “Link copied”. One compact glass card, one line: icon · message · optional text action · close. Redesigned 2026-11-07.

Source: sass/components/_snackbar.scss · templates/partials/snackbar.html

window.showSnackbar(message, type = "info", duration = 4000, action = null);
// action: { label, onClick } — one text button; runs, then dismisses.
window.showSnackbar("Added to reading list", "saved", 5000,
    { label: t.view, onClick: () => ReadingList.open("saved") });
RuleWhy
One at a time — a new toast replaces the oldReceipts, not a feed.
Phones: docked bottom-left, clear of the FAB rail; desktop: centredIt never covers the search / reader buttons. Centred with auto margins, never a transform (see glass invariants).
Glass only on the visible cardOne blur layer at most.
Semantic colour on the icon onlyNo side stripes, no countdown bar.
Types info, success, error, warning, saved, unsavedsaved/unsaved draw a filled / outline bookmark.

Saving to the reading list offers View (opens the Saved tab); removing offers Undo. Labels are the snackbarView / snackbarUndo keys in all ten languages. The service worker’s “Page saved for offline reading” toast was retired — it fired on every save, replacing the localized receipt with English text; offline caching is now a silent side effect (woh:page-cached event).

Live examples#

  • Modal mixin — open search (/ or the navbar search affordance).
  • Snackbar — bookmark any entry; a confirmation toast appears.

Edit this page on GitHub