@timmo001/groundwork-tokens

中文文档
0.9.33发布于 2026/11/03Apache-2.0ES Module构建来源已验证

Groundwork's design tokens: the theme schema, the OKLCH solver and every theme as CSS and JSON

原始使用文档

@timmo001/groundwork-tokens

Groundwork's design tokens: the theme schema, the OKLCH solver that turns a theme into every role in light, dark and Darker, and every core and optional theme as CSS and JSON.

Install

bun add -E @timmo001/groundwork-tokens

Use

The CSS sets every --gw-* custom property for each theme and mode, chosen by data-gw-theme and data-gw-mode:

import "@timmo001/groundwork-tokens/themes.css";
<html data-gw-theme="base" data-gw-mode="dark"></html>

themes.json holds the same solved themes as data. The runtime export solves and applies a theme in the browser, for apps that let people bring their own:

import { parseTheme, runtimeTheme } from "@timmo001/groundwork-tokens/runtime";

The omarchy-current export reads and watches the Omarchy theme a machine is using, for apps outside a browser, such as a desktop app's main process or a terminal UI. pageTheme's setOmarchyTheme offers it in the view:

import {
  readOmarchyTheme,
  watchOmarchyTheme,
} from "@timmo001/groundwork-tokens/omarchy-current";

The themes, their roles and contrast targets are documented at groundwork.timmo.dev/themes.

版本与发布记录

@timmo001/groundwork-tokens 共发布 44 个版本,首次发布于 2026/11/01;过去 12 个月发布了 44 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.9.33latest2026/11/03今天
0.9.322026/11/021 天前
0.9.312026/11/021 天前
0.9.302026/11/021 天前
0.9.292026/11/021 天前
0.9.282026/11/021 天前

关于 @timmo001/groundwork-tokens 的常见问题

@timmo001/groundwork-tokens 是什么?

地基的设计标志:主题模式,OKLCH求解器和每个主题作为CSS和JSON

如何安装 @timmo001/groundwork-tokens?

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

@timmo001/groundwork-tokens 支持 TypeScript 吗?

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

@timmo001/groundwork-tokens 支持 ESM 还是 CommonJS?

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

@timmo001/groundwork-tokens 可以商用吗?

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

@timmo001/groundwork-tokens 还在维护吗?

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