Skip to content

@vibe-labs/design-gradients

Gradient tokens and utility classes for the Vibe Design System — directional, card, accent, shimmer, fade, and depth gradients.

Installation

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

Tokens

CSS custom properties defined in @layer vibe.tokens:

Direction

TokenDefault
--gradient-directionto bottom

Card / Surface

TokenDescription
--gradient-cardStandard card gradient (neutral 800 → 900)
--gradient-card-subtleSubtle card gradient (neutral 850 → 900)
--gradient-card-elevatedElevated card gradient (neutral 750 → 850)

Accent

TokenDescription
--gradient-accentBrand accent gradient (135deg)
--gradient-accent-subtleSubtle accent wash (low opacity)

Functional

TokenDescription
--gradient-shimmerHorizontal shimmer effect
--gradient-fade-t/b/l/rDirectional fades to --surface-base
--gradient-depthRadial vignette overlay

Utilities / Generated Classes

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

Direction

.bg-gradient-to-t · .bg-gradient-to-tr · .bg-gradient-to-r · .bg-gradient-to-br · .bg-gradient-to-b · .bg-gradient-to-bl · .bg-gradient-to-l · .bg-gradient-to-tl · .bg-gradient-radial

Sets --gradient-direction for use in custom gradients.

Semantic Gradients

  • Card: .bg-gradient-card · .bg-gradient-card-subtle · .bg-gradient-card-elevated
  • Accent: .bg-gradient-accent · .bg-gradient-accent-subtle
  • Shimmer: .bg-gradient-shimmer
  • Fades: .bg-gradient-fade-t · .bg-gradient-fade-b · .bg-gradient-fade-l · .bg-gradient-fade-r
  • Depth: .bg-gradient-depth
  • Reset: .bg-gradient-none

Dist Structure

FileDescription
index.cssBarrel — imports both files below
gradients.cssToken definitions
gradients.g.cssGenerated utility classes

Dependencies

Requires --color-neutral-*, --color-accent, --color-accent-dark, and --surface-base tokens from upstream packages.

Build

bash
npm run build

Usage Guide

Provides semantic gradient tokens and utility classes for surfaces, accents, fades, shimmer, and depth effects in the Vibe Design System.

Import

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

Common Patterns

1. Standard card with gradient background

html
<div class="bg-gradient-card rounded-xl p-6">
  Card with subtle gradient depth
</div>

2. Elevated card (slightly brighter)

html
<div class="bg-gradient-card-elevated rounded-xl p-6 shadow-md">
  Featured or highlighted card
</div>

3. Accent gradient for hero or CTA sections

html
<section class="bg-gradient-accent p-16 text-center">
  <h1 class="text-display-lg font-bold">Call to Action</h1>
  <button class="btn-lg mt-8">Get Started</button>
</section>

4. Fade overlay at the bottom of a scrollable list

html
<div class="relative overflow-hidden h-48">
  <ul><!-- long list --></ul>
  <div class="bg-gradient-fade-b absolute bottom-0 left-0 right-0 h-16 pointer-events-none"></div>
</div>

5. Shimmer loading skeleton

html
<div class="bg-gradient-shimmer animate-pulse rounded-md h-4 w-48"></div>
<div class="bg-gradient-shimmer animate-pulse rounded-md h-4 w-32 mt-2"></div>

6. Radial vignette depth overlay on imagery

html
<div class="relative">
  <img src="background.jpg" class="w-full object-cover" alt="" />
  <div class="bg-gradient-depth absolute inset-0"></div>
  <h2 class="absolute bottom-8 left-8 text-display-sm font-bold">Caption</h2>
</div>

Token Reference

TokenDescription
--gradient-cardneutral 800 → 900 (standard)
--gradient-card-subtleneutral 850 → 900 (de-emphasized)
--gradient-card-elevatedneutral 750 → 850 (prominent)
--gradient-accentBrand accent at 135deg
--gradient-shimmerHorizontal shimmer sweep
--gradient-fade-bFade to surface-base (bottom)
--gradient-depthRadial vignette

Vibe