@getflip/swirl-tokens

中文文档
2.14.3发布于 2026/05/19SEE LICENSE IN LICENSE.md零依赖构建来源已验证近 30 天下载 1.9万

Swirl Design System Tokens package with a number of different formats for Web and Mobile.

原始使用文档

Swirl Tokens

When using design systems colors, you would usually start with a color palette consisting of values from 100 to 900, like green600. These values are static and are not themable. In Swirl, we intentionally skip this core layer and instead work with the semantic color tokens.

Semantic color tokens represent not just a color value but also a semantic role it's used for. By assigning semantic roles to colors, we achieve predictable theming and dark mode support.

We use generic names for the color tokens, which means that color names don't rely on our component inventory. So you can build your custom components using the same color tokens, and they will still automatically support theming and dark mode.

Installation

npm install @getflip/swirl-tokens

Usage

JSON

Accessing all of the available token groups

import styles from "@getflip/swirl-tokens/dist/styles.json";

console.log("background-default", styles["background-default"]);

CSS

Importing all of the css variables. CSS variables are prefixed with --s

@import "@getflip/swirl-tokens/dist/css/styles.custom-properties.css";

div {
  background-color: var(--s-background-default);
}

SCSS

LESS

版本与发布记录

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

版本发布日期距今
2.14.3latest2026/05/195 个月前
2.14.22026/05/076 个月前
2.14.12026/03/307 个月前
2.14.02026/03/197 个月前
2.14.0-beta-20260316143104beta2026/03/168 个月前
2.14.0-beta-202603161309002026/03/168 个月前

关于 @getflip/swirl-tokens 的常见问题

@getflip/swirl-tokens 是什么?

Swirl Design System Tokens package with a number of different formats for Web and Mobile.

如何安装 @getflip/swirl-tokens?

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

@getflip/swirl-tokens 支持 TypeScript 吗?

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

@getflip/swirl-tokens 可以商用吗?

@getflip/swirl-tokens 使用 SEE LICENSE IN LICENSE.md 许可。许可条款写在包内的独立文件中,请阅读该文件确认可否商用。以上为概括,不构成法律意见,请以许可原文为准。

@getflip/swirl-tokens 的下载量有多少?

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

@getflip/swirl-tokens 还在维护吗?

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