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

@ds-mo/tokens

v6.5.0

Published

TokoMo design tokens — colors, dimensions, typography, and effects as CSS custom properties, JSON, and TypeScript constants

Readme

@ds-mo/tokens

Design tokens as CSS custom properties, JSON, and TypeScript constants — the token foundation for the CompoMo design system.

Part of the design system trilogy: TokoMo (@ds-mo/tokens) → IcoMo (@ds-mo/icons) → CompoMo (@ds-mo/ui)

Figma-first: tokens are exported from Figma variables and built into CSS via generator scripts. Drop in new JSON, run the build, everything updates.

npm version

Install

npm install @ds-mo/tokens
# or
pnpm add @ds-mo/tokens

# Local development (no npm publish needed):
pnpm add file:../path/to/tokomo

Usage

CSS

/* All tokens at once */
@import '@ds-mo/tokens';

/* Or selectively */
@import '@ds-mo/tokens/colors';
@import '@ds-mo/tokens/dimensions';
@import '@ds-mo/tokens/typography';
@import '@ds-mo/tokens/effects';

/* Optional: base styles (font loading, reduced-motion, focus rings) */
@import '@ds-mo/tokens/globals';

/* Optional: CSS reset */
@import '@ds-mo/tokens/reset';

JS / TypeScript (via bundler)

import '@ds-mo/tokens';
import '@ds-mo/tokens/globals';

// Type-safe token name constants
import { colorBackgroundPrimary, dimensionSpace200 } from '@ds-mo/tokens/ts';
// value is just the CSS variable name string: '--color-background-primary'
element.style.setProperty(colorBackgroundPrimary, 'red');

JSON (for tooling, plugins, etc.)

import tokens from '@ds-mo/tokens/json';
import colors from '@ds-mo/tokens/json/colors';

Selection guidance

@ds-mo/tokens/agent is the single machine-readable contract for choosing and composing tokens. It contains framework-neutral principles, the nine color intents, token-family guidance, and recipes for semantic color pairing, interaction layers, typography composites, and elevation.

import guidance from '@ds-mo/tokens/agent';

const colorFamilies = guidance.families.filter(family => family.category === 'color');
const typeRecipes = guidance.recipes.find(recipe => recipe.id === 'token-recipe:typography-composites');

The documentation site renders the same contract for people under Browser / Documentation / Color Tool. The Browser shows values; Documentation intentionally explains selection with token names only.

Theming

Light/dark theme is controlled via a data-theme attribute on <html>:

document.documentElement.setAttribute('data-theme', 'dark');
document.documentElement.setAttribute('data-theme', 'light');

Light is the default. No JS required — pure CSS variable overrides.

Token categories

| File | Prefix | Contains | |---|---|---| | colors.css | --color-* | Semantic colors (light + dark), reference palette, data viz | | dimensions.css | --dimension-* | Space, radius, size, stroke-width, fixed layout constraints, transforms, and z-index | | typography.css | --typography-* | Font family, weight, font-size, line-height, letter-spacing, paragraph spacing | | effects.css | --effect-* | Blur, animation timing, easing, elevation shadows |

Typography ships CSS primitives rather than .text-* classes. TokoMo itself defines the recommended display/title/body/caption × regular/emphasis composites in @ds-mo/tokens/agent, so any framework or component library can implement them consistently. See docs/guidelines/typography-usage.md.

Scaling

--dimension-base is 8px. The spacing, radius, size, and stroke-width category bases alias it by default, so one override scales those four token scales together:

:root {
  --dimension-base: 10px;
}

Each category also has its own override point. Radius therefore has a separate base while still resolving to the same 8px default:

:root {
  --dimension-space-base: 10px;
  --dimension-radius-base: 6px;
}

Fixed layout widths/heights, z-index layers, unitless transform scales, and --dimension-radius-half do not inherit --dimension-base; choose those by their documented role rather than expecting a global scale override. Offset tokens do follow the spacing base.

Elevation

Each suffix publishes a public outer shadow, inset highlight, and combined elevation token. Use the combined token by default:

/* Normal one-element case */
.surface { box-shadow: var(--effect-elevation-elevated-sm); }

/* Split only when the paint/clipping hierarchy requires two layers */
.surface-frame {
  box-shadow: var(--effect-shadow-elevated-sm);
}
.surface-content {
  overflow: hidden;
  box-shadow: var(--effect-highlight-elevated-sm);
}

Keep split parts on the same suffix. An element's own overflow does not automatically require a split; use it when an ancestor or inner clipping boundary would otherwise cut a descendant's outer shadow. See docs/guidelines/elevation-usage.md.

Available: elevated-none, elevated-sm, elevated-md, elevated-floating, depressed-sm, depressed-md, elevated-panel-top/right/bottom/left

Updating from Figma

  1. Export updated variable JSON from Figma
  2. Drop into src/json/{colors,dimensions,typography,effects}/
  3. Run the build:
node scripts/build.mjs

Dev

node scripts/build.mjs          # full build
node scripts/build.mjs --watch  # watch mode

License

MIT