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

design-canvas-plugin-style-kit

v0.1.6

Published

Token-aware design tuning — explore scales, override live, save variations, ship changes

Readme

Style Kit — Design Canvas Plugin

Token-aware design tuning for Fluent UI applications. Explore token scales, override values live, save variations, prompt Copilot for adjustments, and ship changes via GitHub Issues or PRs.

Features

  • Token Detection — Automatically identifies the token framework in use (Fluent UI, Material Design, Spectrum, Chakra UI, or custom tokens) and maps element styles to their corresponding design tokens.

  • Live Override Engine — Adjust spacing, typography, colors, border radius, shadows, stroke widths, and motion tokens in real time. Changes are applied instantly via CSS custom property overrides.

  • Scope Control — Three levels of override targeting:

    | Scope | Target | Example | |-------|--------|---------| | Global | .fui-FluentProvider | Every element using that token | | Component | .fui-Card (all instances) | Every Card on the page | | Element | Specific CSS selector | One particular element |

    Pick any element on the canvas to inspect and tune its specific token usage, then choose the scope level for your override.

  • Variations — Save named sets of overrides as variations. Switch between Base and saved variations to compare different design directions.

  • Copilot Integration — Natural language prompt bar for AI-powered style adjustments (e.g., "make it more compact" or "darker background"). Copilot suggests token changes based on your description.

  • Search & Filter — Browse all available tokens with search and category filter pills (Spacing, Typography, Colors, Shape, Motion).

  • Handoff & Export — Copy CSS overrides, theme partials, or generate a full fix prompt for Copilot. Create GitHub Issues with context screenshots and assign Copilot for automated fixes.

  • Light/Dark Mode — Full dark mode support with a dedicated token system (--sk-* custom properties) that adapts to the host application's theme.

  • Accessibility — ARIA attributes, keyboard navigation, screen reader labels, and semantic roles throughout the panel UI.

Installation

npm install design-canvas-plugin-style-kit

Peer Dependencies

  • @design-canvas/toolbox >= 0.1.0

Usage

Register the plugin with your Design Canvas instance:

import plugin from 'design-canvas-plugin-style-kit';

// In your Design Canvas setup:
canvas.registerPlugin(plugin);

The plugin exposes the standard Design Canvas plugin interface:

plugin.meta       // { id, name, icon, description, panel }
plugin.activate(ctx)   // Mount the panel, start detection
plugin.deactivate()    // Clean up listeners and DOM
plugin.getAPI()        // { getOverrides, serializeOverrides, applyOverride, clearAll }
plugin.getHandoffContext()  // { overrides, css, themePartial }

Keyboard Shortcut

| Shortcut | Action | |----------|--------| | Ctrl+Shift+K | Toggle Style Kit panel |

Development

# Install dependencies
npm install

# Start dev harness (Vite + HMR)
npm run dev:ui

# Build for production
npm run build

# Watch mode (library output)
npm run dev

# Validate plugin structure
npm run validate

# Full verification (structure + types + patterns)
npm run verify

Dev Harness

The dev/ folder contains a standalone test harness that simulates the Design Canvas panel shell. It provides:

  • Light/dark theme toggle
  • Sample DOM elements for token detection testing
  • Panel open/close simulation
  • Full HMR via Vite

Open http://localhost:5174 after running npm run dev:ui.

Architecture

src/
├── index.ts            # Plugin entry — meta, activate/deactivate, API
├── panel.ts            # Panel DOM renderer (imperative, no framework)
├── panel-styles.ts     # All CSS as a template literal with --sk-* tokens
├── token-registry.ts   # Static token scale definitions + framework detection
├── token-detector.ts   # Maps element computed styles → token matches
├── override-engine.ts  # Applies/tracks CSS custom property overrides
└── variations.ts       # Persistence layer for named override sets

Token System

The panel uses its own --sk-* CSS custom property system for theming:

| Token | Purpose | |-------|---------| | --sk-bg | Panel background | | --sk-bg-subtle | Section backgrounds | | --sk-bg-accent | Interactive accents | | --sk-fg | Primary text | | --sk-fg-secondary | Secondary text | | --sk-border | Borders | | --sk-success | Success states | | --sk-pulse-color | Animation highlight |

Light and dark values are defined on .sk and .sk.sk--dark respectively.

API

getOverrides(): TokenOverride[]

Returns the current list of active token overrides.

serializeOverrides(): { overrides, css, themePartial }

Serializes all active overrides into exportable formats:

  • overrides — Structured array with token names, old/new values, scope
  • css — Ready-to-paste CSS custom property declarations
  • themePartial — Framework-specific theme object partial

applyOverride(tokenName, value, scope): void

Programmatically apply a token override.

clearAll(): void

Remove all active overrides and reset to base values.

License

MIT