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

@designtools/tokens

v0.1.6

Published

Headless colour token generation from brand colours: OKLCH primitive scales, contrast-checked semantic intents, light/dark modes, and serialisers for CSS custom properties (lead), Tailwind v3/v4, DTCG, and Lovable. Pure TypeScript, deterministic.

Readme

@designtools/tokens

Colour token generation from brand colours, as pure TypeScript. generateTokens({ primary, neutral }) produces a TokenSystem — twelve-step OKLCH scales, contrast-checked semantic intents, surfaces, utilities, in light and dark — and exportTokens(tokens, format) serialises it, with CSS custom properties as the lead format and Tailwind v3/v4, DTCG, and Lovable as secondary outputs. No browser, DOM, or React.

Part of the @designtools/* suite; the designtools-tokens skill (in skills/) drives it at scaffold time.

Usage

Published, the CLI is generate-tokens:

npx @designtools/tokens --primary "#4e9caf"                          # CSS custom properties to stdout
npx @designtools/tokens --primary "#4e9caf" --vanilla --out tokens.css
npx @designtools/tokens --primary "#4e9caf" --format all --out ./tokens

From source in this monorepo (no build needed):

npx tsx packages/tokens/src/cli.ts --primary "#4e9caf"

Programmatic:

import { generateTokens, exportTokens } from "@designtools/tokens";

const tokens = generateTokens({ primary: "#4e9caf", neutral: "#9aa1af" });
const css = exportTokens(tokens, "css", { colorFormat: "oklch" });

Pass --vanilla (or compat: false) to omit the shadcn/ui aliases from the css and tailwind-v4 outputs — the right default for Base UI / vanilla-CSS stacks. Full input/output contracts, options, and export formats live in skills/designtools-tokens/SKILL.md.

Layout

src/     types, oklch, primitives, semantic, generate, export, index (barrel), cli
test/    parity tests, fixture cases, golden fixtures, fixture regenerator

Runtime dependencies: culori (colour maths) and apca-w3 (APCA contrast), both pure JS. Built with tsup to ESM plus a compiled generate-tokens bin; dist/ is produced at build/publish time and is not committed.

Commands

npm -w packages/tokens run build        # tsup -> dist (ESM + generate-tokens bin + .d.ts)
npm -w packages/tokens run typecheck
npm -w packages/tokens run cli -- --primary "#4e9caf"
npm -w packages/tokens run fixtures     # regenerate goldens — only when a behaviour change is intended
npm test                                # parity tests run in the repo's vitest suite

Determinism and parity

Same seeds and options always produce byte-identical output — pure arithmetic, no randomness, clocks, or environment reads. test/ pins that: the generator must reproduce the golden fixtures in test/fixtures/, which were generated from the original Colour Token Generator web-tool source. Regenerate them (run fixtures) only when a behaviour change is intended.

src/ (except index.ts and cli.ts) is a verbatim copy of that web tool's library, so the two stay in step; src/export.ts is the one deliberate exception, carrying the compat toggle behind --vanilla, with its own fixtures. This package is the canonical source.