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

@huiliyi37/dsh-client-ui-theme

v0.4.0

Published

Theme plugin: ThemeService (light/dark/system preference, prefers-color-scheme resolution, theme/change snapshots; no DOM), --dsw-* token base stylesheets; registers the Appearance settings row

Readme

@huiliyi37/dsh-client-ui-theme

English | 中文

主题插件:基于 --dsw-* token 基础样式表(静态尺度 + 别名语义层)的 ThemeService。该服务拥有主题偏好(lightdarksystem,以 dsh.theme 为键持久化),将 system 通过 prefers-color-scheme 解析为实际主题,并发布不可变的 ThemeSnapshot,通过 theme/change 事件通知变化;它绝不接触 DOM:ui-layout 的呈现器会应用解析后的快照(html { color-scheme }body[data-ds-dark-theme],以及主题的别名 token 内联变量)。约定:api-contracts v3 §8。

src/styles/ 下有五张样式表,全部由 web 壳的 base.css 导入:base.cssdesign-platform.cssscrollbar.cssgradient-shadow-text.cssshiki.cssscrollbar.css--dsw-alias-scrollbar-* token 的唯一消费方,必须排在声明这些 token 的 design-platform.css 之后。

滚动条重新绑定约定:scrollbar.cssbody 上把 --dsh-scrollbar-thumb--dsh-scrollbar-thumb-hover 绑定到 l1(基础表面)token,两条渲染路径都读取这一组变量。高层级表面(菜单、浮层、对话框)在自己的容器上设置 --dsh-scrollbar-thumb: var(--dsw-alias-scrollbar-bg-l2)--dsh-scrollbar-thumb-hover: var(--dsw-alias-scrollbar-hover-l2);一次重新绑定即可为引擎实际走的那条路径换色。这组变量的另一个合法目标是 transparent,即完全不绘制滑块——ui-sidebar 在指针不在栏内时就这样重新绑定自己的列。绑回 l1 那组不算重新绑定,它只是重述基础表面的默认值。

两条路径在构造上互斥。scrollbar-widthscrollbar-color 写在 @supports not selector(::-webkit-scrollbar) 之内,因为这两个属性中的任一个只要取非 auto 值,Chromium 与 Safari 就会丢弃该元素上的全部 ::-webkit-scrollbar* 规则,::-webkit-scrollbar-thumb:hover 也在其中——若无条件地同时声明,--dsh-scrollbar-thumb-hover 在任何引擎上都不会被渲染。因此 Firefox 走标准属性,WebKit 系引擎走伪元素,hover token 只经由伪元素这条路径渲染。推理过程与实测计算值见滚动条 Agent Note

模型体验

无。主题服务管理浏览器偏好;这里没有任何内容进入模型请求。

KV Cache 影响

无;该包(package)既不组装也不发送提供方请求。

已知限制与暂缓事项

  • 第三方主题是表层,不是产品:注册主题意味着覆盖同名别名变量;目前不会验证一组覆盖是否完整。
  • token 样式表是颜色值的唯一权威来源:会有意不补入 cssdesign 中缺失的值(例如设计中的 #4176E6 标签页蓝色);一律采用最接近的语义 token(裁定于 2026-07-22)。设计负责人批准的新增值是例外:须在同一变更中以一个静态尺度层级与一个语义别名的形式进入(--dsw-static-blue-900 / --dsw-alias-label-primary-bluish,2026-08-07)。