@hashicorp/design-system-tokens

中文文档
6.0.1发布于 2026/11/10MPL-2.0ES Module零依赖近 30 天下载 12.7万

Helios Design Tokens

原始使用文档
文档目录6 节
  1. Compatibility
  2. Installation
  3. Usage
  4. Contributing
  5. License
  6. Versioning

design-system-tokens

A package containing the design tokens of the Helios Design System.

npm version

Compatibility

Any platform/framework that can process CSS files and can use CSS custom properties ("variables") or use CSS helper classes.

Installation

pnpm add @hashicorp/design-system-tokens

Then import one of those files in your app's style file (app.scss or similar):

// to use design tokens as CSS variables
//
~/dist/products/css/tokens.css  // for product applications

// to use the CSS helper classes
//
~/dist/[products]/css/helpers/colors.css     // for color styles
~/dist/[products]/css/helpers/elevation.css  // for elevation styles
~/dist/[products]/css/helpers/typography.css // for typographic styles
~/dist/[products]/css/helpers/focus-ring.css // for focus-ring style

Usage

See the dedicated page on the components website: https://helios.hashicorp.design/foundations/tokens

Contributing

See the Contributing guide for details.

License

This project is licensed under the Mozilla Public License 2.0.

Versioning

We use SemVer for versioning.

版本与发布记录

@hashicorp/design-system-tokens 共发布 173 个版本,首次发布于 2021/10/20;过去 12 个月发布了 97 个版本。

版本发布日期距今
6.0.1latest2026/11/107 天前
6.0.02026/10/071 个月前
6.0.0-rc-202610070910272026/10/071 个月前
6.0.0-rc-20261007091042rc2026/10/071 个月前
6.0.0-rc-202610051426302026/10/051 个月前
6.0.0-rc-202610011723152026/10/021 个月前

关于 @hashicorp/design-system-tokens 的常见问题

@hashicorp/design-system-tokens 是什么?

Helios Design Tokens

如何安装 @hashicorp/design-system-tokens?

在项目目录运行 npm install @hashicorp/design-system-tokens,或使用 pnpm add / yarn add / bun add。

@hashicorp/design-system-tokens 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/hashicorp__design-system-tokens 是否存在。

@hashicorp/design-system-tokens 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@hashicorp/design-system-tokens 可以商用吗?

@hashicorp/design-system-tokens 使用 MPL-2.0 许可。弱 Copyleft:可以商用,也可以和闭源代码一起使用;但如果分发时修改了 MPL 授权的文件,这些文件的修改需以 MPL 开源。以上为概括,不构成法律意见,请以许可原文为准。

@hashicorp/design-system-tokens 的下载量有多少?

根据 npm 官方下载统计,@hashicorp/design-system-tokens 在 2026/10/18 – 2026/11/16 这 30 天内被下载 126,968 次,日均约 4,232 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@hashicorp/design-system-tokens 还在维护吗?

最新版本 6.0.1 发布于 2026/11/10(7 天前);至今共发布 173 个版本,其中过去 12 个月发布了 97 个;首次发布于 2021/10/20。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。