@fuzdev/fuz_css

中文文档
0.81.0发布于 2026/11/090BSDTypeScriptES Module近 30 天下载 4904

semantic-first CSS framework and design system: styled HTML defaults, themes derived from a few knobs, and utility classes generated from what you use

原始使用文档
文档目录7 节
  1. Install
  2. Usage
  3. Without a build step
  4. Semantic first
  5. Coming from Tailwind
  6. Contributing
  7. License 🐦

fuz_css

a fuzzy tuft of green moss

CSS with more utility 🪴

fuz_css is a semantic-first CSS framework and design system. Semantic HTML looks finished with zero classes: headings, links, buttons, forms, tables, and callouts come styled, and block elements space themselves. Themes are a handful of knobs, not a stylesheet: hues, intents, lightness curves, and scales re-derive every color and size in plain CSS, and the contrast, gamut, and ramp-order checks the shipped themes pass are an API you can run on your own. A Vite plugin generates one stylesheet holding only the variables, base styles, and utility classes your code uses, for Svelte, React, Preact, Solid, and plain HTML.

Browse the docs at css.fuz.dev, and try the theme editor. More about the stack at fuz.dev.

It's in early alpha with breaking changes ahead. Feedback and design input is welcome in the discussions.

Install

npm i -D @fuzdev/fuz_css

Usage

Add the Vite plugin:

// vite.config.ts
import {defineConfig} from 'vite';
import {sveltekit} from '@sveltejs/kit/vite';
import {vite_plugin_fuz_css} from '@fuzdev/fuz_css/vite_plugin_fuz_css.ts';

export default defineConfig({
    plugins: [sveltekit(), vite_plugin_fuz_css()],
});

Then import its virtual module once, from your root layout or entry file:

import 'virtual:fuz.css';

For JSX (React, Preact, Solid), install acorn-jsx and pass it as vite_plugin_fuz_css({acorn_plugins: [jsx()]}). The setup docs cover each framework and the TypeScript declaration for the virtual module.

Without a build step

The package's two plain stylesheets work in any page, the base style.css and theme.css with every variable. jsDelivr serves them from npm - pin a version:

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fuzdev/fuz_css@VERSION/dist/theme.css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fuzdev/fuz_css@VERSION/dist/style.css" />

That's the full semantic styling; utility classes and baked-in themes need the plugin.

Semantic first

This form looks finished, themed, and spaced with only a built-in convention class:

<form>
    <label>
        <div class="title">email</div>
        <input type="email" />
    </label>
    <button>subscribe</button>
</form>

The title class is one of the built-in conventions the base styles recognize, like selected and palette_c. When the defaults don't cover something, reach for a class:

<!-- composite, token, and literal classes -->
<div class="row gap_md justify-content:space-between">
    <button class="palette_c">delete</button>
    <button class="selected">saved</button>
</div>

Coming from Tailwind

  • The root font size is 62.5%, so 1rem is 10px at the browser default and body text is 1.6rem. Every rem length on the page follows it, including third-party ones, which render at 62.5% of what their authors intended. Tailwind's p-4 is 1rem, 16px; here 16px is 1.6rem, and the spacing tokens carry the scale (p_xl is 16px at the defaults).
  • Utilities are generated from what you use, found by parsing your source rather than matching it with a regex.
  • Four class types: token classes map to design variables (p_md, color_a_50), keyword classes are CSS keywords that name their property (flex, sticky, uppercase), composites bundle properties (row, box, panel), and literals are CSS itself in property:value form (justify-content:center, margin:0~auto), with modifiers like md: and hover:.
  • Tailwind's keyword names resolve, its own names don't: a Tailwind project's flex, hidden, or sticky gets the same CSS here, but items-center and justify-between generate nothing, with no warning, so flex items-center half-works. Spell those as literals (align-items:center).
  • Tokens, keywords, and literals beat composites: composites render in a lower cascade layer, so panel shadow_md gets the medium shadow whatever the class order.

More in the classes docs.

Contributing

fuz.dev/contributing

License 🐦

0BSD

版本与发布记录

@fuzdev/fuz_css 共发布 58 个版本,首次发布于 2025/12/07;过去 12 个月发布了 58 个版本。

版本发布日期距今
0.81.0latest2026/11/096 天前
0.80.02026/11/097 天前
0.79.02026/11/087 天前
0.78.02026/11/087 天前
0.77.02026/11/087 天前
0.76.22026/11/087 天前

关于 @fuzdev/fuz_css 的常见问题

@fuzdev/fuz_css 是什么?

semantic-first CSS framework and design system: styled HTML defaults, themes derived from a few knobs, and utility classes generated from what you use

如何安装 @fuzdev/fuz_css?

在项目目录运行 npm install @fuzdev/fuz_css,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@fuzdev/fuz_util(>=0.81.0)、@fuzdev/fuz_schema(^0.5.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@fuzdev/fuz_css 支持 TypeScript 吗?

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

@fuzdev/fuz_css 支持 ESM 还是 CommonJS?

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

@fuzdev/fuz_css 需要什么版本的 Node.js?

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

@fuzdev/fuz_css 可以商用吗?

@fuzdev/fuz_css 使用 0BSD 许可。几乎没有限制:可自由使用、修改和分发,连保留版权声明也不要求。以上为概括,不构成法律意见,请以许可原文为准。

@fuzdev/fuz_css 的下载量有多少?

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

@fuzdev/fuz_css 还在维护吗?

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