Skip to content

@vibe-labs/design-borders

Border tokens and utility classes for the Vibe Design System — radius, width, style, color, and divide utilities.

Installation

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

Tokens

CSS custom properties defined in @layer vibe.tokens:

TokenDefaultDescription
--radius-none--radius-full09999pxBorder radius scale (none, sm, md, lg, xl, 2xl, full)
--border-width-0--border-width-404pxBorder width scale (0, 1, 2, 4)
--border-default--color-neutral-600Standard border color
--border-strong--color-neutral-400Emphasized border color
--border-subtle--color-neutral-750De-emphasized border color

Utilities / Generated Classes

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

Border Radius

  • .rounded-{size} — all corners: none | sm | md | lg | xl | 2xl | full
  • .rounded-{side}-{size} — directional: t | r | b | l

Border Width

  • .border / .border-{n} — all sides (0, 1, 2, 4; .border = 1)
  • .border-{side} / .border-{side}-{n} — per side: t | r | b | l | x | y

Border Style

.border-solid · .border-dashed · .border-dotted · .border-none

Border Color

  • Semantic: .border-default · .border-strong · .border-subtle · .border-transparent
  • Palette: .border-{color} — blue, brown, cyan, green, indigo, orange, pink, purple, red, teal, yellow
  • Status: .border-success · .border-warning · .border-danger · .border-info

Divide

  • .divide-x / .divide-y — sibling dividers (applies to * + *)
  • .divide-strong — stronger divider color

Dist Structure

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

Dependencies

Requires --color-* tokens from @vibe-labs/design-colors (or equivalent).

Build

bash
npm build

Usage Guide

Provides border radius, width, style, color, and divide utilities for consistent edge treatment across the Vibe Design System.

Import

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

Common Patterns

1. Standard card with subtle border

html
<div class="rounded-lg border border-subtle p-6">
  Card content
</div>

2. Input field with focus state

html
<input
  class="rounded-md border border-default focus:border-strong"
  type="text"
/>

3. Status badge with colored border

html
<span class="rounded-full border border-success px-3 py-1 text-sm">
  Active
</span>

<span class="rounded-full border border-danger px-3 py-1 text-sm">
  Error
</span>

4. Dividers between list items

html
<ul class="divide-y">
  <li class="py-3">Item one</li>
  <li class="py-3">Item two</li>
  <li class="py-3">Item three</li>
</ul>

5. Avatar with full circle and colored ring

html
<img
  class="rounded-full border-2 border-blue"
  src="avatar.jpg"
  alt="User"
/>

6. Top-only border as visual separator

html
<footer class="border-t border-subtle pt-8 mt-16">
  Footer content
</footer>

Token Reference

TokenValueDescription
--radius-smsmallSubtle rounding
--radius-mdmediumDefault for inputs
--radius-lglargeCards, panels
--radius-full9999pxPills, avatars
--border-defaultneutral-600Standard border
--border-strongneutral-400Emphasized border
--border-subtleneutral-750De-emphasized border

Vibe