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

@deweyou-design/styles

v0.1.0

Published

Theme tokens, global CSS entrypoints, and Less bridges for Deweyou UI.

Readme

@deweyou-design/styles

Shared color palette, semantic theme tokens, CSS theme outputs, and Less authoring utilities for Deweyou Design.

Installation

npm install @deweyou-design/styles

CSS Entry Points

| Import | Description | | --------------------------------------------- | ---------------------------------------------------------------------- | | @deweyou-design/styles/theme.css | Default consumer entry — reset, base, theme layers, and fallback fonts | | @deweyou-design/styles/theme-with-fonts.css | Full Source Han Sans SC + Serif CN webfont entry for previews | | @deweyou-design/styles/theme-light.css | Light theme only | | @deweyou-design/styles/theme-dark.css | Dark theme only | | @deweyou-design/styles/color.css | Raw color palette — theme-invariant tokens | | @deweyou-design/styles/reset.css | Reset layer only | | @deweyou-design/styles/base.css | Base typography and element defaults |

Import theme.css once at your app root:

import '@deweyou-design/styles/theme.css';

theme.css defines typography tokens and platform fallback stacks, but does not load the full bundled Source Han files. Use theme-with-fonts.css only when the full webfont payload is acceptable.

Font Subsets

For production apps that want Source Han typography with a smaller first-paint payload, configure the build-time plugin and import the generated virtual CSS:

// vite.config.ts
import { fontSubset } from '@deweyou-design/styles/unplugin-font-subset';

export default {
  plugins: [
    fontSubset.vite({
      scan: {
        include: ['src/**/*.{ts,tsx,md,mdx,json}'],
        exclude: ['**/*.test.*', 'src/generated/**'],
      },
    }),
  ],
};
// app entry
import '@deweyou-design/styles/theme.css';
import 'virtual:deweyou-font-subset.css';

The final character set is built from the built-in Latin/punctuation safelist, explicit charset files, optional scanned source files, user safelist additions, and blocklist removals. The plugin emits hashed woff2 files and @font-face rules for the configured Source Han family.

Font subset options

Most apps only need scan.include. The lower-level knobs exist for constrained builds and generated content:

| Option | Default | Description | | ---------------- | ---------------------- | ---------------------------------------------------------------------------- | | scan.include | — | Project files to scan for literal characters. | | scan.exclude | common build/test dirs | Extra files to skip. | | charset | — | Explicit text files whose characters must be included. | | safelist.chars | — | Literal characters to force into the subset. | | safelist.files | — | Files whose characters should be forced into the subset. | | blocklist | — | Characters to remove after scanning and safelisting. | | source | source-han-serif-cn | Low-level font source override; most apps should leave this unset. | | family | source family | CSS font-family override; also infers the built-in source when recognized. | | weights | [400,500,600,700] | Low-level emitted subset weights. | | output.fontDir | assets/fonts | Final bundle directory for generated subset font files. | | inject | false | When true, injects the virtual font modules into Vite HTML automatically. | | fullFonts | false | Set to 'idle' to load stable full font files after page idle. |

Automatic injection is useful for simple Vite SPAs:

fontSubset.vite({
  scan: {
    include: ['src/**/*.{ts,tsx,md,mdx,json}'],
  },
  inject: true,
  fullFonts: 'idle',
});

This is equivalent to importing the subset CSS immediately and, when fullFonts: 'idle' is set, importing the idle full-font loader:

import 'virtual:deweyou-font-subset.css';
import 'virtual:deweyou-full-fonts-loader.js';

fullFonts: 'idle' keeps subset fonts on the critical path and registers full vendored fonts later through the FontFace API. Full font assets use stable versioned names such as source-han-serif-cn-full-400-v2.003R.otf, so repeat visits can reuse browser cache until the vendored font version changes.

Less Authoring Utilities

@import '@deweyou-design/styles/less/bridge'; // CSS custom property aliases as Less variables
@import '@deweyou-design/styles/less/mixins'; // Authoring mixins for component authors

JavaScript / TypeScript API

import {
  colorFamilyNames, // 26 color family names
  colorPalette, // colorPalette.<family>.<step> lookup
  colorPaletteStepNames, // '50' | '100' | … | '950'
  baseMonochrome, // { black, white }
  publicThemeTokens, // governed semantic token names
  createThemeStyleSheets,
} from '@deweyou-design/styles';

Semantic Theme Tokens

Governed tokens that components may consume. These map to theme-specific values in light and dark mode:

  • --ui-color-black / --ui-color-white
  • --ui-color-brand-bg / --ui-color-brand-bg-hover / --ui-color-brand-bg-active
  • --ui-color-text-on-brand
  • --ui-color-danger-bg / --ui-color-danger-bg-hover / --ui-color-danger-bg-active
  • --ui-color-danger-text / --ui-color-text-on-danger
  • --ui-color-focus-ring
  • --ui-color-surface-raised / --ui-color-brand-text

共享基础色卡(Color Palette)

26 color families, each with 11 steps (50 to 950):

red, orange, amber, yellow, lime, green, emerald, teal, cyan, sky, blue, indigo, violet, purple, fuchsia, pink, rose, slate, gray, zinc, neutral, stone, taupe, mauve, mist, olive

Plus baseMonochrome: black and white.

Typography Contract

  • --ui-font-body and --ui-font-control default to a Source Han Sans SC stack for controls and dense UI.
  • --ui-font-content and --ui-font-display default to a Source Han Serif CN stack for Markdown, Text, and display typography.
  • --ui-font-mono is the explicit exception for code and fixed-width content.
  • Bundled and subset webfont files are covered by the SIL Open Font License 1.1.

Governance Rules

  • Semantic tokens must trace back to the shared color palette or black / white.
  • 非必要不得新增特化 token — do not add component-specific tokens without first proving the shared palette cannot serve the need.
  • The canonical color review matrix lives in the Storybook Color story.

License

MIT