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

@rightkit/theme

v0.3.1

Published

Brand file to CSS tokens generator for Right Suite apps: light/dark/system, derived dark accent, WCAG contrast and hard-coded-colour checks, runtime brand application.

Readme

@rightkit/theme

Brand file to CSS-token generator for Right Suite apps. It handles light, dark and system modes, a derived dark accent, WCAG contrast checks, hard-coded colour scanning and runtime brand application.

| Item | Value | |---|---| | Where it runs | Build tooling (Node CLI and ./node helpers), and app webview UI (applyBrand, runtime) | | Rust pair | None | | Version | see INDEX.md | | License | MIT OR Apache-2.0 |

Entry points

| Import | Contents | |---|---| | @rightkit/theme | Browser-safe modules, including the token helpers applyTokens, aliasTokens, SUITE_ALIASES, presetTokens, fontTokens (see Token helpers below): colour helpers (parseHex, contrastRatio, readableOn, ensureContrast), brand (parseBrand, resolveBrand, SUITE_DEFAULTS), CSS (generateCss, modeVars), checks (checkBrandContrast, scanHardcodedColors, checkGeneratedCss), runtime (applyBrand, brandFromAccent, themeBootScript, prefersDark, onPrefersDarkChange) | | @rightkit/theme/node | Node-only: readBrand, generateFile, checkBrandFile, checkLogo, scanFiles, and a re-export of checkGeneratedCss. Uses node:fs and node:path. Do not import it in a browser bundle. | | rightkit-theme (bin) | generate <brand.json> --out <file.css> [--format suite\|tailwind\|both] [--check] [--allow-contrast-failures], contrast <brand.json>, tokens <file...> (hard-coded colour scan) |

Peer dependencies: none.

Example

import { readFileSync } from "node:fs";
import { parseBrand, generateCss } from "@rightkit/theme";

const brand = parseBrand(JSON.parse(readFileSync("brand.json", "utf8")));
const css = generateCss(brand, { format: "suite" });
pnpm exec rightkit-theme generate brand.json --out src/theme.css --check

Token helpers

Apps keep their own CSS variable names (ViewRight's --ink, --paper, a theme preset x accent palette, a font stack) and set them without touching anything else:

import { applyTokens, aliasTokens, presetTokens, fontTokens, SUITE_ALIASES } from "@rightkit/theme";

const undo = applyTokens({
  ...presetTokens(activePreset, accentId),        // { "--ink": "#101216", "--copper": "#0C6AA5", ... }
  ...fontTokens({ mono: "Menlo, monospace" }),    // --rk-font-mono
  ...aliasTokens({ "--focus": "--rk-focus" }),    // unprefixed name -> suite token (a name the preset does not set; later spreads win)
});
undo(); // restores the previous inline value of each name it set
  • applyTokens(record, root?) writes custom properties on root's inline style, skips undefined values and returns an undo function. Names must match --name.
  • aliasTokens(map) returns var(--target) references for unprefixed names. SUITE_ALIASES is the same map as @rightkit/react-shell/suite-aliases.css; a test in this package keeps them in step.
  • presetTokens(preset, accentId?) merges an accent over a preset's base tokens.
  • fontTokens({ mono, body, wordmark }) maps font stacks onto --rk-font-mono, --rk-font-body and --rk-wordmark-font.
  • presetCss(presets, { attribute? }) emits :root[data-palette="<id>"] blocks for generated preset stylesheets; aliasCss(map) emits the :root alias block as CSS; tailwindThemeCss(tokens, { prefix? }) emits a Tailwind v4 @theme block (default prefix --color-) so presetTokens output can feed @theme.

applyBrand(brand, mode, root, { applySuiteAliases: true }) also writes the flat suite aliases. It is off by default, because writing --ink or --panel would overwrite an app that owns those names.

Known issues

  • ./node imports Node built-ins. Browser bundles must import only the root entry.