Skip to main content
PaperStack
Buy Pro

Design Tokens

PaperStack uses CSS custom properties as the single source of truth for all visual decisions. Tokens are defined in @paperstack/tokens as SCSS variables that compile to :root custom properties, making them available globally and overridable by any theme.

All tokens follow the prefix --ps- internally and are exposed via friendly SCSS variables in the tokens/ package.

Colors

The palette is built around three semantic families that reflect the paper metaphor:

FamilyCustom Property PrefixDescription
Parchment--color-parchment-*Warm paper tones from cream to aged brown
G2 (ink)--color-g2-*Blue, black, red, green — classic pen ink colors
Stabilo--color-stabilo-*Highlighter-inspired accent colors

Each shade is available in steps 50 → 950. Semantic aliases like --color-surface, --color-text, --color-border remap to the appropriate shade at theme level.

/* Direct palette token */
background: var(--color-parchment-100);

/* Semantic alias */
color: var(--color-text);
border-color: var(--color-border);

Typography

Five font stacks power the typographic system:

TokenStackUse case
--font-uiInter, system-uiUI controls, labels, navigation
--font-readingEB Garamond, GeorgiaLong-form prose, article text
--font-headingLora, GeorgiaSection headings
--font-displayPlayfair Display, GeorgiaHero headings, display text
--font-monoJetBrains Mono, Fira CodeCode, terminal output

The type scale uses a modular ratio. Steps range from --text-xs through --text-4xl.

font-size: var(--text-base);    /* 1rem */
font-size: var(--text-lg);     /* ~1.25rem */
font-size: var(--text-2xl);    /* ~1.563rem */

Spacing

Spacing follows a 4-point base grid. The scale runs from --space-px (1px) through --space-24 (96px) with named steps for density-aware layouts.

padding: var(--space-4);      /* 16px at default density */
gap: var(--space-2);          /* 8px */
margin-block: var(--space-8); /* 32px */

Content density (compact, default, comfortable) scales spacing tokens automatically via the density system.

Border Radius

TokenValueUse case
--radius-none0Flat / newspaper style
--radius-xs2pxBadges, tags
--radius-sm4pxInputs, buttons
--radius-md6pxCards, panels
--radius-lg8pxModals, drawers
--radius-paper1px 2pxPaper-edge corners
--radius-full9999pxPills, avatars

Shadows

Shadow tokens convey the physical paper layering metaphor. Each level corresponds to how far "off the desk" an element floats.

TokenUse case
--shadow-0Flat, no elevation
--shadow-1Subtle lift (cards)
--shadow-paperPaper sheet resting on surface
--shadow-stackStack of papers
--shadow-floatFloating menus, popovers
--shadow-drawerDrawers, modals

Motion

Motion tokens balance expressiveness with the prefers-reduced-motion media query. All durations automatically collapse to near-zero when reduced motion is preferred.

TokenValueUse case
--duration-instant50msState toggles
--duration-fast100msHover transitions
--duration-normal200msMost UI transitions
--duration-slow400msPanel opens, page transitions
--ease-standardcubic-bezier(0.4, 0, 0.2, 1)General purpose
--ease-entercubic-bezier(0, 0, 0.2, 1)Elements entering
--ease-exitcubic-bezier(0.4, 0, 1, 1)Elements leaving

Z-Index

TokenValueLayer
--z-base0Default flow
--z-raised10Sticky headers, raised cards
--z-dropdown100Dropdowns, popovers
--z-overlay200Modals, drawers
--z-toast300Toast notifications
--z-tooltip400Tooltips

Breakpoints

NameMin-widthTarget
xs320pxSmall phones
sm480pxLarge phones
md768pxTablets
lg1024pxLaptops
xl1280pxDesktops
2xl1440pxWide monitors
4xl1728pxUltra-wide

Usage in JS / TypeScript

Import token constants from the JS/TS entry point:

import {
  THEMES,
  FONT_FAMILIES,
  BREAKPOINTS,
  CONTENT_WIDTHS,
} from "@paperstack/tokens";

These are typed, readonly tuples and objects — useful for theme switchers, responsive utilities, and programmatic style generation.