npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ship-it-ui/tokens

v0.0.9

Published

Design tokens for the Ship-It design system. The single source of truth for color, type, spacing, radius, shadow, motion, breakpoints, and z-index.

Readme

@ship-it-ui/tokens

The single source of truth for design tokens used across the Ship-It design system.

How this fits in

Part of the Ship-It Design System. See the architecture overview for how @ship-it-ui/tokens, @ship-it-ui/icons, @ship-it-ui/ui, and @ship-it-ui/shipit compose.

What's a token?

A token is a named design decision — color.brand, space.4, radius.md. Components consume tokens, never raw values. Changing a token in one place updates every component that uses it.

Two layers of color

We use a two-layer color system, both defined in src/color.ts:

  1. Primitive (colorPrimitive) — raw OKLCH ramps for the companion palette (ok, warn, err, purple, pink). Components must not import these directly.
  2. Semantic (colorSemanticDark, colorSemanticLight) — the role-based aliases components actually consume: bg, panel, panel-2, border, borderStrong, text, textMuted, textDim, accent, accentText, accentDim, accentGlow, plus the companion palette (ok/warn/err/etc.) and their on-surface foregrounds.

scripts/build-css.ts emits both maps to styles/tokens.css — dark on :root, light overrides on [data-theme='light']. @ship-it-ui/ui/styles/globals.css re-binds those CSS variables into Tailwind v4's @theme inline block so utility classes like bg-bg, text-text, border-border resolve to them.

A separate runtime knob, --accent-h, lets consumers rotate every accent-derived OKLCH color by overriding a single CSS variable — no component changes needed.

This decoupling means we can reskin the system (swap palettes, rotate the accent hue) without changing a single component.

How tokens reach your components

src/*.ts                     scripts/build-css.ts                styles/tokens.css
TypeScript token modules ───────────────► CSS variables ───────────► consumed by
                                                                       Tailwind v4
                                                                       (@ship-it-ui/ui)

Token consumers have two options:

// Option A — TypeScript (e.g., for inline styles, tests, or theme objects)
import { spacing, colorSemanticLight } from '@ship-it-ui/tokens';

// Option B — CSS variables (preferred inside components)
import '@ship-it-ui/tokens/styles/tokens.css';
// then use var(--color-text), var(--space-4), etc. — or Tailwind utilities
// like `text-text` and `p-4` since the @ship-it-ui/ui Tailwind config is wired
// to these variables.

Adding or changing a token

  1. Edit the relevant module in src/ (e.g., src/spacing.ts).
  2. Run pnpm --filter @ship-it-ui/tokens build to regenerate styles/tokens.css.
  3. If you renamed a token, search the monorepo for the old name and update consumers.
  4. Add a Changeset describing the bump:
    • patch — internal cleanup, no consumer-visible change
    • minor — new token added
    • major — token renamed or removed (breaking change)

Consumer customization

App developers consuming this package can re-skin color and typography tokens via a ship-it.config.ts file at the consumer's repo root, processed by the shipit build-tokens CLI shipped from this package. See docs/customizing-tokens.md for the full guide.

Quick reference:

// ship-it.config.ts
import { defineConfig } from '@ship-it-ui/tokens/config';

export default defineConfig({
  accentH: 280,
  color: { dark: { panel: '#0d0f14' } },
  typography: { fontFamily: { sans: '"Söhne", system-ui, sans-serif' } },
});

Files

| File | Purpose | | ---------------------- | -------------------------------------------------------------- | | src/color.ts | Primitive palette + light/dark semantic color aliases | | src/typography.ts | Font families, sizes, weights, line-heights, tracking | | src/spacing.ts | 4px-based spacing scale | | src/radius.ts | Border-radius tokens | | src/shadow.ts | Light + dark elevation shadows | | src/motion.ts | Durations + easing curves | | src/breakpoint.ts | Responsive breakpoints | | src/z-index.ts | Named stacking layers | | scripts/build-css.ts | Emits styles/tokens.css from TS sources | | styles/tokens.css | Generated. Imported by @ship-it-ui/ui/styles/globals.css |