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

@josui/tokens

v0.3.1

Published

Design tokens in DTCG format, built with Terrazzo CLI. Supports light/dark theming.

Readme

@josui/tokens

Design tokens in DTCG format, built with Terrazzo CLI. Supports light/dark theming.

Installation

pnpm add @josui/tokens

Usage

CSS Variables

@import '@josui/tokens/css';

.custom {
  color: var(--color-primary-500);
  padding: var(--spacing-4);
  border-radius: var(--radius-md);
}

Tailwind CSS v4

@import 'tailwindcss';
@import '@josui/tokens/tailwind';

/* Then use standard Tailwind classes */
/* bg-primary-500, text-secondary-700, p-4, etc. */

Note: The tokens export does not include @import 'tailwindcss' - you must import Tailwind separately. This allows you to control the import order and disable default Tailwind colors if needed.

SCSS (Type-Safe)

@use '@josui/tokens/scss' as tokens;

.custom {
  // Compile-time validated token access
  color: tokens.token('color.primary.500');
  padding: tokens.token('spacing.4');
}

JavaScript

import { token } from '@josui/tokens';

// Function-based accessor
const primaryColor = token('color.primary.500');
const spacing = token('spacing.4');

// Access mode-specific values
const darkBg = token('color.background', 'dark');
const lightBg = token('color.background', 'light');

Theming (Light/Dark Mode)

Tokens support automatic light/dark theming via system preference and manual toggle.

Automatic (System Preference)

<!-- Respects prefers-color-scheme automatically -->
<html>
  <body>
    ...
  </body>
</html>

Manual Toggle

<!-- Force dark mode -->
<html data-theme="dark">
  <!-- or -->
  <html class="dark">
    <!-- Force light mode -->
    <html data-theme="light">
      <!-- or -->
      <html class="light"></html>
    </html>
  </html>
</html>

Semantic Tokens

These tokens automatically adapt to light/dark mode:

| Token | Light | Dark | Use Case | | -------------------------------- | ----------- | ---------- | ------------------- | | --color-background | White | Near black | Page background | | --color-foreground | Near black | Near white | Primary text | | --color-card-background | White | Near black | Card surfaces | | --color-popover-background | White | Near black | Popover surfaces | | --color-muted-background | Light gray | Dark gray | Muted backgrounds | | --color-accent-background | Light gray | Dark gray | Highlighted content | | --color-destructive-background | Red | Darker red | Destructive actions | | --color-success-background | Light green | Dark green | Success alerts | | --color-warning-background | Light amber | Dark amber | Warning alerts | | --color-error-background | Light red | Dark red | Error alerts | | --color-info-background | Light blue | Dark blue | Info alerts | | --color-border | Light gray | Dark gray | Borders | | --color-input | Light gray | Dark gray | Input borders | | --color-ring | Primary | Primary | Focus rings |

Each semantic token has a -foreground variant for text (e.g., --color-card-foreground, --color-success-foreground).

Color System

All colors use OKLCH color space for perceptual uniformity.

Primitive Palettes

| Palette | Base (500) | Use Case | | --------- | ---------------------- | ------------------------ | | Primary | oklch(0.85 0.17 72) | Warm amber - brand color | | Secondary | oklch(0.62 0.26 295) | Purple - accents | | Tertiary | oklch(0.6 0.22 260) | Blue-violet - highlights | | Gray | Neutral scale | Text, backgrounds | | Success | Green | Positive feedback | | Warning | Yellow | Caution states | | Error | Red | Error states | | Info | Blue | Informational |

Each palette has 11 shades: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950.

Token Categories

| Category | Examples | Description | | ----------- | --------------------------------------------- | ---------------------- | | Colors | --color-primary-500 | OKLCH color palettes | | Typography | --font-size-default, --font-weight-medium | Font properties | | Spacing | --spacing-4 | 0-96 scale (rem-based) | | Radius | --radius-md | Border radius values | | Shadows | --shadow-lg | Box shadow definitions | | Animation | --animation-duration-fast | Timing values | | Z-index | --z-index-modal | Layering scale | | Breakpoints | --breakpoint-md | Responsive breakpoints | | Opacity | --opacity-50 | Opacity scale |

Exports

| Export | Path | Description | | ---------- | ------------------------ | ------------------------ | | JavaScript | @josui/tokens | Token accessor function | | CSS | @josui/tokens/css | CSS custom properties | | Tailwind | @josui/tokens/tailwind | Tailwind v4 theme | | SCSS | @josui/tokens/scss | Type-safe SCSS functions |

AI-Assisted Development

This package includes a skill for AI coding assistants. Copy it to your project:

cp -r node_modules/@josui/tokens/skills/add-token .claude/skills/

The skill helps AI assistants correctly add and customize design tokens.