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

modelgo-design-tokens

v0.5.1

Published

ModelGo 四端统一设计 token(CSS 变量,框架无关):品牌色阶 / 字体 / 字阶 / 圆角 / 间距 / 按钮。

Readme

modelgo-design-tokens

ModelGo 四端(控制台 / 国内官网 / 国外官网 / 文档站)统一设计 token 的单一真源。 纯 CSS 变量,框架无关——React / Astro / VitePress 都能用。

为什么是 token 而不是组件

四端技术栈不同(React·Vite / Astro / VitePress),跨框架共享「组件」几乎不可能; 能真正统一的是 CSS 变量层。各端组件自己实现,但都消费同一套 --mg-*,风格自然一致。

安装

pnpm add modelgo-design-tokens

使用

入口 CSS 顶部引入一次:

@import 'modelgo-design-tokens/tokens.css';

然后全站只用 --mg-* 变量,不再写硬编码值:

.btn {
  height: var(--mg-btn-height);
  padding-inline: var(--mg-btn-pad-x);
  border-radius: var(--mg-btn-radius);
  font-size: var(--mg-btn-text);
  background: var(--mg-brand-base);
}
h1 { font-size: var(--mg-text-h1); line-height: var(--mg-text-h1-line); }

Tailwind v4 的站点(国内官网)在 @theme 里映射即可:

@theme {
  --color-brand: var(--mg-brand-base);
  --font-size-h1: var(--mg-text-h1);
}

双市场 / 双主题

  • 市场:根元素 data-market="global" → 品牌色切 emerald;缺省 = 国内 indigo。
  • 主题data-theme="dark" → 语义色切深色。

契约(变量名)始终不变,只是值被覆盖。

双品牌色阶(两套常驻)

两套品牌 ramp 都常驻、可分别引用,--mg-brand-* 永远指向当前市场

--mg-brand-cn-*       国内 indigo(deep/base/mid/light/pale/purple)
--mg-brand-global-*   海外 emerald
--mg-brand-*          = 当前市场(随 data-market 切)—— 日常用这个

需要在某市场里固定显示另一市场色(极少见)才用 --mg-brand-cn-* / --mg-brand-global-*

用法规范

值统一 ≠ 用法统一。怎么用见 USAGE.md(颜色/字阶/wordmark/按钮/层级的 do & don't)。

Token 分类

| 组 | 前缀 | 说明 | |---|---|---| | 品牌色阶 | --mg-brand-{deep,base,mid,light,pale} | 5 阶 ramp,按 market 切 | | 字体 | --mg-font-{sans,display,mono,brand-latin,brand-cjk} | 字体族名(字体文件各端自托管) | | 字阶 | --mg-text-{hero,h1,h2,h3,body,sm,xs} + -line / -tracking | | | 圆角 | --mg-radius-{xs,sm,md,lg,xl,pill} | | | 间距 | --mg-space-{1,2,3,4,6,8,12,section} | | | 按钮 | --mg-btn-{height,height-sm,pad-x,radius,text,weight} | | | 语义色 | --mg-bg, --mg-bg-alt, --mg-text-{0,1,2}, --mg-border | 按主题切 |

落地节奏(建议)

  1. 发布本包到 npm(公共)。
  2. 选一端先接(建议国内官网),把本地变量改成引用 --mg-*,跑通构建+部署。
  3. 验证无误后,其余三端逐个接入,删掉各自重复的 token 定义。

tokens.css 里的具体数值是「对账两端现状后的起步建议」,可按设计意图调整; 价值在于统一命名 + 单一来源,改视觉只改这一个文件、四端同步。