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

@symblight/md-colors

v0.1.1

Published

Material Design 3 color token generator — CSS custom property output in oklch format

Readme

@symblight/md-colors

Material Design 3 color token generator. Takes a source color and derives a full MD3 tonal palette, outputting --md-sys-color-* tokens in oklch format.

Built on @material/material-color-utilities.

Install

npm install @symblight/md-colors

Builds

| Build | Entry | Format | Use case | |---|---|---|---| | Node / bundler | dist/index.js | ESM | generateTokens, generateCSSFile | | Browser (bundler) | dist/client.esm.js | ESM | Vite, Storybook — named import | | Browser (script) | dist/client.js | IIFE | Plain <script> tag | | CLI | dist/cli.js | ESM | Terminal usage via md-colors |


Node — programmatic API

import { generateTokens, generateCSSFile } from "@symblight/md-colors";

generateTokens(config)

Returns a token map — use it to apply tokens however you like.

const tokens = generateTokens({ sourceColor: "#6750A4", scheme: "dark" });
// { "--md-sys-color-primary": "oklch(…)", … }

| Param | Type | Default | Description | |---|---|---|---| | config.sourceColor | string | "#1D5D78" | Seed color as a hex string | | config.scheme | "light" \| "dark" | "light" | Color scheme variant |

generateCSSFile(config)

Writes a colors.css file with :root-scoped tokens.

generateCSSFile({
  sourceColor: "#6750A4",
  scheme: "dark",
  output: "./theme/colors.css",
});

| Param | Type | Default | Description | |---|---|---|---| | config.sourceColor | string | "#1D5D78" | Seed color as a hex string | | config.scheme | "light" \| "dark" | "light" | Color scheme variant | | config.output | string | ./colors.css (next to module) | Output file path |

Output:

:root {
  --md-sys-color-primary: oklch(...);
  --md-sys-color-on-primary: oklch(...);
  --md-sys-color-surface-container-highest: oklch(...);
  /* …all MD3 system color tokens */
}

Browser client — runtime theming

Import generateTheme and call it directly — no globals, no window assignment.

Named import (Vite, Storybook, bundler)

import { generateTheme } from "@symblight/md-colors/client";

generateTheme({ sourceColor: "#6750A4", scheme: "dark" });

Via <script> tag (no bundler)

<script type="module">
  import { generateTheme } from "./node_modules/@symblight/md-colors/dist/client.esm.js";
  generateTheme({ sourceColor: "#6750A4", scheme: "dark" });
</script>

Or with the self-contained IIFE build:

<script src="node_modules/@symblight/md-colors/dist/client.js"></script>
<script>
  // client.js exposes nothing on window — use it as an ES module instead (see above)
</script>

generateTheme(options)

| Param | Type | Default | Description | |---|---|---|---| | options.sourceColor | string | — | Seed color as a hex string | | options.scheme | "light" \| "dark" | "light" | Color scheme variant |

Sets every --md-sys-color-* variable on document.documentElement via style.setProperty.


CLI

# npx (no install)
npx md-colors --sourceColor="#6750A4" --scheme=dark --output=./theme/colors.css

# global install
npm install -g @symblight/md-colors
md-colors --sourceColor="#6750A4" --scheme=light --output=./colors.css

Options

| Flag | Short | Default | Description | |---|---|---|---| | --sourceColor | -c | #1D5D78 | Seed color as a hex string | | --scheme | -s | light | light or dark | | --output | -o | ./colors.css | Output file path |


Development

pnpm build            # Build all dist outputs
pnpm generate-theme   # Write colors.css via CLI (uses defaults)
pnpm test             # Run Jest tests

License

MIT © Aleksei Tkachenko