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

@tini-work/tokens

v2.3.0

Published

Design token system for the tini component library. Provides OKLCH color scales, spacing, typography, radius, shadows, and motion tokens — output as CSS variables, a Tailwind preset, and typed TypeScript constants.

Readme

@tini-work/tokens

Design token system for the tini component library. Provides OKLCH color scales, spacing, typography, radius, shadows, and motion tokens — output as CSS variables, a Tailwind preset, and typed TypeScript constants.

Installation

npm install @tini-work/tokens

Exports

| Export | Description | | ---------------------------- | ------------------------------------------------------------------------------------------ | | @tini-work/tokens | Typed TS token constants (colors, spacing, typography, radius, shadow, motion) | | @tini-work/tokens/tailwind | Tailwind v3 preset (tiniPreset) | | @tini-work/tokens/css | CSS file with all custom properties (--primary, --background, etc.) |

Setup

Tailwind v4

Import the CSS directly — no preset needed:

@import "@tini-work/tokens/css";

Tailwind v3

Add the preset to your config:

import { tiniPreset } from '@tini-work/tokens/tailwind'

export default {
  presets: [tiniPreset],
}

CSS variables only

@import "@tini-work/tokens/css";

Then use tokens directly in your styles:

.my-element {
  color: var(--foreground);
  background: var(--background);
  border-radius: var(--radius);
}

Token Categories

| Category | Tokens | | ------------ | ---------------------------------------------------------------------------------------------------------------------------------- | | colors | OKLCH color scales (light + dark), semantic aliases (--primary, --background, --foreground, …), chart colors, severity scale | | spacing | Spacing scale (maps to Tailwind spacing utilities) | | typography | Font families, sizes, weights, line heights, letter spacing | | radius | Border radius scale + base --radius variable | | shadow | Box shadow scale (light + dark variants) | | motion | Transition duration scale + easing curves + presets |

Dark mode

Dark mode is handled via a mode selector. By default, the CSS file emits overrides under both:

  • .dark { … } (compatibility with common Tailwind conventions)
  • [data-mode="dark"] { … } (supports subtree theming)
<html class="dark">
  <!-- all tokens automatically switch to dark values -->
</html>

Themes (brand packs) and subtree theming

Themes are handled via a theme selector. The recommended API is:

  • [data-theme="<id>"] { … } (supports subtree theming)
  • Optional sugar: .theme-<id> { … }

This allows global theming:

<!-- Intent: apply a brand theme to the whole app -->
<html data-theme="acme">
  …
</html>

And subtree theming (e.g. previews, embedded widgets, multi-tenant sections):

<!-- Intent: theme only a section without affecting the rest of the page -->
<section data-theme="acme">
  …
</section>

Dark mode composes with themes (orthogonal axes):

<!-- Intent: apply a brand theme + dark mode together -->
<html data-theme="acme" class="dark">
  …
</html>

TypeScript usage

import { colors, spacing, typography, radius, shadow, motion } from '@tini-work/tokens'
import type { Colors, Spacing, Typography, Radius, Shadow, Motion } from '@tini-work/tokens'

Note: TypeScript exports represent the default token definitions. Multi-theme customization is intended to be CSS-first (override variables via selectors).

App semantic extensions (--app-*)

Consumer apps can define additional semantic variables under the reserved --app-* namespace.

/* Intent: app-specific semantics that compose from the design system contract */
:root {
  --app-shell: var(--background);
  --app-shell-foreground: var(--foreground);
}

If you want Tailwind utilities for these, opt-in by mapping them in your own Tailwind config (the preset intentionally does not generate app-* keys).

Token pipeline

Tokens are defined in src/*.json and compiled by scripts/build-tokens.mjs into:

  • generated/tokens.ts — typed TypeScript constants
  • generated/tailwind-preset.ts — Tailwind v3 theme extension
  • generated/css-variables.css — CSS custom properties

Run the build manually:

pnpm --filter @tini-work/tokens build:tokens   # regenerate from JSON sources
pnpm --filter @tini-work/tokens build          # build:tokens + tsup (JS/DTS output)
pnpm --filter @tini-work/tokens validate:contrast  # validate WCAG contrast ratios

License

MIT