Skip to content

@vibe-labs/design-display

Display, position, overflow, visibility, and z-index tokens and utility classes for the Vibe Design System.

Installation

css
@import "@vibe-labs/design-display";

Tokens

CSS custom properties defined in @layer vibe.tokens:

TokenValueDescription
--z-base0Default stacking context
--z-dropdown100Dropdown menus
--z-sticky200Sticky elements
--z-overlay300Overlays / backdrops
--z-modal400Modal dialogs
--z-popover500Popovers / tooltips
--z-toast600Toast notifications

Utilities / Generated Classes

Utility classes generated into @layer vibe.utilities via the build script.

Display

.block · .inline-block · .inline · .hidden · .contents

Position

.static · .relative · .absolute · .fixed · .sticky

Inset

  • Zero: .inset-0 · .inset-x-0 · .inset-y-0 · .top-0 · .right-0 · .bottom-0 · .left-0
  • Auto: .inset-auto · .top-auto · .right-auto · .bottom-auto · .left-auto
  • Full: .inset-full

Overflow

.overflow-{value} · .overflow-x-{value} · .overflow-y-{value} — where value is hidden | auto | scroll | visible

Visibility

.visible · .invisible

Z-Index

.z-{level}base | dropdown | sticky | overlay | modal | popover | toast

Dist Structure

FileDescription
index.cssBarrel — imports both files below
display.cssToken definitions (z-index scale)
display.g.cssGenerated utility classes

Dependencies

None — this package is self-contained.

Build

bash
npm run build

Usage Guide

Provides display, position, overflow, visibility, and z-index utilities for controlling how elements are rendered and stacked in the Vibe Design System.

Import

css
@import "@vibe-labs/design-display";

Common Patterns

1. Absolutely positioned overlay

html
<div class="relative">
  <img src="hero.jpg" alt="" class="block w-full" />
  <div class="absolute inset-0 bg-overlay opacity-50"></div>
  <h1 class="absolute bottom-0 left-0 p-8">Title</h1>
</div>

2. Sticky header with correct z-index

html
<header class="sticky top-0 z-sticky bg-base border-b border-subtle">
  Navigation
</header>

3. Modal stacking order

html
<div class="fixed inset-0 z-overlay overlay-scrim"></div>
<dialog class="fixed z-modal bg-modal rounded-xl p-8 shadow-2xl">
  Modal content
</dialog>

4. Tooltip above modal

html
<div class="fixed z-popover bg-base rounded-md p-2 shadow-lg text-sm">
  Tooltip text
</div>

5. Hide an element visually but keep in flow

html
<span class="invisible">Placeholder — preserves layout space</span>

6. Scrollable inner container

html
<div class="overflow-y-auto overflow-x-hidden" style="height: 400px;">
  <ul><!-- long content --></ul>
</div>

Token Reference

TokenValueStacking context
--z-base0Normal content
--z-dropdown100Dropdown menus
--z-sticky200Sticky headers
--z-overlay300Backdrop scrims
--z-modal400Modals
--z-popover500Tooltips, popovers
--z-toast600Toast notifications

Vibe