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

basetoken

v1.0.0

Published

Generate Material Design 3 color tokens from a seed color using the HCT color space. Outputs CSS custom properties for light, dark, and contrast-adjusted schemes.

Downloads

9

Readme

BaseToken

Generate Material Design 3 color tokens from a seed color using the HCT color space.

Outputs CSS custom properties for light, dark, and contrast-adjusted schemes — ready to drop into any project.

Live Demo

Features

  • Full Material Design 3 color system from a single hex seed
  • HCT (Hue, Chroma, Tone) color space for perceptually uniform palettes
  • 7 scheme variants: tonal-spot, content, expressive, fidelity, monochrome, neutral, vibrant
  • 3 contrast levels: standard, medium (AA+), high (AAA)
  • Output as oklch, hex, hsl, or rgb
  • Semantic tokens, tonal palettes, and surface roles
  • Open Props–style CSS custom properties

Quick Start

npx basetoken --seed "#6750A4"

This generates a full set of CSS design tokens in ./tokens/:

tokens/
  light.css       # Light scheme tokens
  dark.css        # Dark scheme tokens
  palettes.css    # Tonal palettes (primary, secondary, tertiary, neutral, error)

CLI Options

| Option | Description | Default | |--------|-------------|---------| | -s, --seed <hex> | Seed color as hex (e.g. #769CDF) | required | | -o, --output <dir> | Output directory | ./tokens | | -f, --format <fmt> | Color format: oklch, hex, hsl, rgb | oklch | | --scheme <variant> | Scheme variant (see below) | tonal-spot | | --contrast <level> | Contrast level: standard, medium, high | standard |

Scheme Variants

| Variant | Description | |---------|-------------| | tonal-spot | Balanced, versatile — the M3 default | | content | Colors derived from the seed, muted and harmonious | | expressive | Vivid, high-chroma palettes | | fidelity | Stays close to the exact seed hue and chroma | | monochrome | Grayscale, zero chroma | | neutral | Subtle, low-chroma palette | | vibrant | Bold, saturated colors |

Examples

# Expressive scheme in hex format
npx basetoken --seed "#E8175D" --scheme expressive --format hex

# High contrast, custom output directory
npx basetoken --seed "#1A73E8" --contrast high --output ./design-system/tokens

# Monochrome scheme
npx basetoken --seed "#333333" --scheme monochrome

Interactive Configurator

The live demo site lets you:

  • Pick a seed color and see the generated scheme in real time
  • Compare all 7 scheme variants side by side
  • Toggle between light and dark modes
  • Adjust contrast levels
  • Copy the CLI command or individual color values

Development

Prerequisites

CLI

# Install dependencies
npm install

# Build the CLI
npm run build

# Run the built CLI
node dist/index.js --seed "#769CDF"

# Run during development (no build step)
npm run dev -- --seed "#769CDF"

# Run tests
npm test

Site (Configurator)

cd site

# Install dependencies
npm install

# Dev server
npm run dev

# Production build
npm run build

Tech Stack

CLI: TypeScript, Node.js, Commander.js, @material/material-color-utilities, Culori, tsup

Site: Lit 3 (Web Components), Vite 6, TypeScript — no UI framework, all CSS in Shadow DOM

License

ISC