@_tw/typography

中文文档
0.5.22发布于 2026/03/19MITCommonJS近 30 天下载 3129

A Tailwind CSS plugin that adapts Tailwind Typography styles for the WordPress block editor.

原始使用文档

_tw Typography

A Tailwind CSS plugin created for _tw that improves support for Tailwind Typography within the WordPress block editor by:

  • Partially forking @tailwindcss/typography
  • Adding support for the is-style-lead class alongside lead so that it can be used as a block style
  • Tweaking a handful of CSS rules to add styles not otherwise handled by Tailwind Typography (like citations in quote blocks) and to improve Tailwind Typography support in the absence of Tailwind’s base styles from Preflight.

Usage in Tailwind 3

@_tw/typography must be included in place of @tailwindcss/typography, not alongside it:

// tailwind.config.js
plugins: [
  // Add Tailwind Typography.
  require('@_tw/typography'),
]

@_tw/typography supports the same options as @tailwindcss/typography:

// tailwind.config.js
plugins: [
  // Add Tailwind Typography styles with a custom class name.
  require('@_tw/typography')({
    className: 'wysiwyg',
  }),
]

版本与发布记录

@_tw/typography 共发布 19 个版本,首次发布于 2021/09/09;过去 12 个月发布了 1 个版本。

版本发布日期距今
0.5.22latest2026/03/197 个月前
0.5.212025/10/241 年前
0.5.202025/10/161.1 年前
0.5.20-beta.42025/10/161.1 年前
0.5.20-beta.32025/10/161.1 年前
0.5.20-beta.22025/10/151.1 年前

关于 @_tw/typography 的常见问题

@_tw/typography 是什么?

A Tailwind CSS plugin that adapts Tailwind Typography styles for the WordPress block editor.

如何安装 @_tw/typography?

在项目目录运行 npm install @_tw/typography,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:tailwindcss(>=3.0.0 || insiders || >=4.0.0-alpha.20 || >=4.0.0-beta.1)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@_tw/typography 支持 TypeScript 吗?

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

@_tw/typography 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@_tw/typography 可以商用吗?

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

@_tw/typography 的下载量有多少?

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

@_tw/typography 还在维护吗?

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