Skip to content

@vibe-labs/design-forms

Form reset, input/button tokens, and sizing utilities for the Vibe Design System.

Usage

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

Contents

Reset & Tokens (forms.css)

Form Reset (@layer vibe.reset)

Opinionated form normalization including:

  • Universal box-sizing: border-box and tap highlight removal
  • font: inherit on all form elements with appearance reset
  • cursor: pointer on buttons, cursor: not-allowed + opacity on disabled elements
  • Placeholder color normalization
  • Number input spinner removal
  • Search input clear button removal
  • Vertical-only textarea resize

Tokens (@layer vibe.tokens)

Input sizing:

Tokensmmdlg
--input-height-{size}2rem2.5rem3rem
--input-px-{size}--space-2--space-3--space-4

Input appearance:

TokenDefaultDescription
--input-radius--radius-mdBorder radius
--input-border-width--border-width-1Border width
--input-border--border-subtleDefault border color
--input-border-hover--border-strongHover border color
--input-border-focus--color-accentFocus border color
--input-bg--surface-elevatedBackground
--input-text--text-primaryText color
--input-placeholder--text-mutedPlaceholder color
--input-disabled-opacity0.5Disabled state opacity
--input-focus-ring-width2pxFocus ring width
--input-focus-ring-color--color-accentFocus ring color

Button sizing:

Tokensmmdlg
--btn-height-{size}2rem2.5rem3rem
--btn-px-{size}--space-3--space-4--space-6
--btn-font-size-{size}--text-xs--text-base--text-md

Button appearance:

TokenDefault
--btn-radius--radius-md
--btn-font-weight--font-semibold (600)

Select:

TokenDefault
--select-indicator-size1rem
--select-indicator-color--text-muted

Generated Utilities (forms.g.css)

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

Input Sizing

.input-sm · .input-md · .input-lg — sets height and horizontal padding

Button Sizing

.btn-sm · .btn-md · .btn-lg — sets height, horizontal padding, and font size

Dist Structure

FileDescription
index.cssBarrel — imports both files below
forms.cssForm reset + token definitions
forms.g.cssGenerated sizing utilities

Dependencies

References tokens from spacing (--space-*), borders (--radius-*, --border-width-*, --border-*), colors (--color-accent), surfaces (--surface-*), and typography (--text-*, --font-*) packages.

Build

bash
npm run build