@chassis-ui/css

中文文档
0.14.0发布于 2026/10/31MITTypeScriptES Module零依赖构建来源已验证近 30 天下载 2775

A CSS framework which synchronizes with Figma components by using design tokens.

原始使用文档
文档目录5 节
  1. What the package holds
  2. Use
  3. Documentation
  4. Changes
  5. License

@chassis-ui/css

The CSS framework of the Chassis Design System: tokenized components, context classes for color, and TypeScript-typed JavaScript plugins, built on the design tokens of @chassis-ui/website-tokens.

npm install @chassis-ui/css

The JavaScript plugins use two peer dependencies: @floating-ui/dom (menus, popovers, tooltips) and vanilla-calendar-pro (datepicker). npm 7 and later installs them automatically.

What the package holds

FolderFiles
dist/css/The compiled CSS: chassis.css, and chassis-grid.css, chassis-reboot.css and chassis-utilities.css as separate parts, each with a minified build and source maps
dist/js/The JavaScript as ES modules: chassis.js expects the peer dependencies to be resolved, chassis.bundle.js includes them
dist/tailwind/The entry for Tailwind CSS v4
js/dist/One module per plugin, with type declarations; js/src/ is their TypeScript source
scss/The Sass source
postcss/The PostCSS plugin that adds the --cx- prefix to custom properties

Use

Include the compiled CSS in your HTML, and the JavaScript if you use interactive components:

<link rel="stylesheet" href="node_modules/@chassis-ui/css/dist/css/chassis.min.css">

<!-- Optional: only for interactive components -->
<script type="module" src="node_modules/@chassis-ui/css/dist/js/chassis.bundle.min.js"></script>

Components with a data-attribute API, such as data-cx-toggle="tooltip", initialize themselves. Import a plugin to control a component from code:

import '@chassis-ui/css/dist/css/chassis.min.css'
import { Dialog } from '@chassis-ui/css'

Dialog.getOrCreateInstance('#welcome-dialog').show()

Compile from the Sass source to apply your own tokens and settings:

@use "@chassis-ui/css/scss/config" with (
  $enable-dark-mode: false
);
@use "@chassis-ui/css/scss/chassis";

Sass needs node_modules and the package's scss/vendor/ directory on its load paths, and a PostCSS step adds the --cx- prefix to the custom properties. The installation guide covers both.

In a Tailwind CSS v4 project, import the Tailwind entry instead:

@import "@chassis-ui/css/tailwind";

Documentation

chassis-ui.com/css has the full documentation:

Changes

CHANGELOG.md lists every release. VERSIONING.md says what is public API and which version a change gets.

License

MIT. Chassis CSS is derived from Bootstrap, copyright the Bootstrap Authors and Twitter, Inc., released under the MIT License; see LICENSE.BOOTSTRAP.

版本与发布记录

@chassis-ui/css 共发布 30 个版本,首次发布于 2026/05/03;过去 12 个月发布了 29 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.14.0latest2026/10/319 天前
0.13.02026/10/319 天前
0.12.02026/10/2812 天前
0.11.12026/10/2218 天前
0.11.02026/10/2119 天前
0.10.02026/10/1921 天前

其他发布通道:beta → 0.4.0-0,alpha → 0.5.0-0,next → 0.10.0-next.0。

关于 @chassis-ui/css 的常见问题

@chassis-ui/css 是什么?

A CSS framework which synchronizes with Figma components by using design tokens.

如何安装 @chassis-ui/css?

在项目目录运行 npm install @chassis-ui/css,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@floating-ui/dom(^1.7.6)、vanilla-calendar-pro(^3.1.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@chassis-ui/css 支持 TypeScript 吗?

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

@chassis-ui/css 支持 ESM 还是 CommonJS?

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

@chassis-ui/css 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@chassis-ui/css 可以商用吗?

@chassis-ui/css 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@chassis-ui/css 的下载量有多少?

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

@chassis-ui/css 还在维护吗?

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