@coveord/plasma-tokens

中文文档
60.0.2发布于 2026/09/19Apache-2.0TypeScriptES Module构建来源已验证近 30 天下载 6905

Design tokens of the Plasma Design System

原始使用文档
文档目录7 节
  1. Installation
  2. Usage
  3. TypeScript
  4. Sass
  5. CSS
  6. Icons
  7. Available token libraries

@coveord/plasma-tokens

Design tokens of the Plasma Design System.

What is a design token?

Simply put, a design token is a stored design decision. It can be understood as a variable that holds the result of a choice (in this case made in Figma). Decisions can be made about multiple different subjects, for example colors, typography, spacing, etc. Therefore, it is important to consider that design tokens come in as many types as there are design subjects.

Objective of this package

Distribute design tokens to all Coveo products that rely on the Plasma Design System through code.

Installation

npm install @coveord/plasma-tokens

For TypeScript users: the package provides its own type declarations.

Usage

Tokens are provided through multiple outputs. Choose the format that best suits your needs.

TypeScript

import * as PlasmaTokens from '@coveord/plasma-tokens';

PlasmaTokens.color.primary.actionBlue[6]; // '#1372ec'

Sass

@import '~@coveord/plasma-tokens/scss';
// or individual libraries
@import '~@coveord/plasma-tokens/scss/Colors';

.something {
    background-color: $plasma-color-primary-action-blue-6;
}

CSS

First include the css file you want tokens from in your page.

<link href="/node_modules/@coveord/plasma-tokens/css/Colors.css" rel="stylesheet" />

Tokens in CSS are exposed as CSS variables.

.something {
    background-color: var(--plasma-color-primary-action-blue-6);
}

Icons

All icons are located under the icons folder in .svg format.

If you want to use icons in a React application, refer to @coveord/plasma-react-icons.

Available token libraries

Library NameAvailable FormatsDescription
Iconssvg, typescriptxml markup of the svg elements of all the icons and their variants.
Colorstypescript, scss, cssValues of the different palettes used throughout plasma, also contains gradients.

版本与发布记录

@coveord/plasma-tokens 共发布 187 个版本,首次发布于 2021/12/22;过去 12 个月发布了 15 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
60.0.2latest2026/09/191 个月前
60.0.12026/09/191 个月前
60.0.02026/07/094 个月前
60.0.0-next.0next2026/06/045 个月前
59.4.12026/05/066 个月前
59.1.22026/04/286 个月前

关于 @coveord/plasma-tokens 的常见问题

@coveord/plasma-tokens 是什么?

Design tokens of the Plasma Design System

如何安装 @coveord/plasma-tokens?

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

@coveord/plasma-tokens 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@coveord/plasma-tokens 支持 ESM 还是 CommonJS?

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

@coveord/plasma-tokens 可以商用吗?

@coveord/plasma-tokens 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@coveord/plasma-tokens 的下载量有多少?

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

@coveord/plasma-tokens 还在维护吗?

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