@gluhar/fluid

中文文档
6.4.1发布于 2026/11/16MITES Module零依赖近 30 天下载 2833

Tailwind CSS v4 plugin for fluid, device-banded typography and spacing via clamp().

原始使用文档
文档目录3 节
  1. Use
  2. Rules
  3. Limits (known, by design for now)

@gluhar/fluid

Tailwind CSS v4 plugin: fluid type and spacing via clamp(), with device-banded typography — one ramp per device band, stacked as min-width queries, continuous across band boundaries.

Framework-agnostic: it's a Tailwind plugin, not a Nuxt module. @gluhar/theme does not depend on it.

Use

@import "tailwindcss";
@plugin "@gluhar/fluid" {
  bands: mobile, tablet, desktop;
}

@theme {
  /* min / design / max viewport, px. The LAST band listed is primary. */
  --fl-band-mobile: 320 390 480;
  --fl-band-tablet: 768 820 1200;
  --fl-band-desktop: 1200 1600 1920;

  /* Display: proportional. Plain token = primary band's design value. */
  --text-5xl: 3.75rem;
  --text-5xl--tablet: 2.4375rem 2.625rem 2.8125rem; /* lower base upper */
  --text-5xl--mobile: 1.75rem 2.125rem 2.4375rem;

  /* Body/UI: two values = linear between the band's own endpoints. */
  --text-md: 1rem;
  --text-md--desktop: 0.9375rem 1.05rem;
  --text-md--tablet: 0.9rem 0.9375rem;
  --text-md--mobile: 0.85rem 0.9rem;
}

Then fl-text-5xl, fl-text-md, fl-p-4, fl-gap-8, fl-text-[32px], fl-text-sm/xl, fl-py-4/8.

Rules

  • Once a project uses banded type, use fl-text-* everywhere. Plain text-* gets the single primary value with no ramp.
  • Never put a multi-value form on a plain --text-* token. Tailwind's own text-* emits font-size: var(--text-*) verbatim, so the native utility silently dies. The plugin warns. Put limits on --text-<key>--<band>.
  • Make each band's upper endpoint equal the next band's lower endpoint, so the scale has no step at the breakpoints.
  • Two-value form for body/UI copy (gentle slope); proportional / three-value form for display sizes.

Limits (known, by design for now)

  • Spacing utilities are not banded — they use the primary band's window.
  • Line height is read once (lineHeight: true option), not per band.
  • Arbitrary values (fl-text-[32px]) resolve against the primary band only.

版本与发布记录

@gluhar/fluid 共发布 22 个版本,首次发布于 2026/10/21;过去 12 个月发布了 22 个版本。

版本发布日期距今
6.4.1latest2026/11/16今天
6.4.02026/11/161 天前
6.3.22026/11/161 天前
6.3.12026/11/151 天前
6.3.02026/11/151 天前
6.2.02026/11/151 天前

其他发布通道:next → 6.0.0-next.12。

关于 @gluhar/fluid 的常见问题

@gluhar/fluid 是什么?

Tailwind CSS v4 plugin for fluid, device-banded typography and spacing via clamp().

如何安装 @gluhar/fluid?

在项目目录运行 npm install @gluhar/fluid,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:tailwindcss(^4.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@gluhar/fluid 支持 TypeScript 吗?

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

@gluhar/fluid 支持 ESM 还是 CommonJS?

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

@gluhar/fluid 可以商用吗?

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

@gluhar/fluid 的下载量有多少?

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

@gluhar/fluid 还在维护吗?

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