# @eightshift/frontend-libs-tailwind 中文文档

规范地址：https://npmcn.com/package/%40eightshift/frontend-libs-tailwind/

版本：3\.5\.1
npm 元数据更新时间：2026-11-11T09:38:21.095Z
中文译文更新时间：2026-11-14T05:07:52.096Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40eightshift/frontend-libs-tailwind
原文对照：https://npmcn.com/package/%40eightshift/frontend-libs-tailwind/?lang=original
项目主页：https://github.com/infinum/eightshift-frontend-libs-tailwind#readme
源码仓库：https://github.com/infinum/eightshift-frontend-libs-tailwind

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：228 kB，67 个文件
- TypeScript 类型：未声明
- 运行依赖：33 个
- peer 依赖：@eightshift/ui-components ^8\.0\.0
- 首次发布：2024-07-01T06:20:02.667Z
- 最新版本发布：2026-11-11T09:38:20.527Z
- 近 30 天下载量：2313（2026-10-13 至 2026-11-11，npm 官方下载统计）
- 已发布版本数：44（近 12 个月 15 个）

## 中文简介

由 Tailwind CSS 提供的以样式创建现代古腾堡主题的框架.

## 安装

```sh
npm install @eightshift/frontend-libs-tailwind
```

也可以使用：`pnpm add @eightshift/frontend-libs-tailwind`、`yarn add @eightshift/frontend-libs-tailwind`、`bun add @eightshift/frontend-libs-tailwind`

## README

![image](https://repository-images.githubusercontent.com/180566063/638d50be-e474-42e5-9673-1d35365ace05)

[![GitHub tag](https://img.shields.io/github/tag/infinum/eightshift-frontend-libs-tailwind.svg?style=for-the-badge)](https://github.com/infinum/eightshift-frontend-libs-tailwind/) [![GitHub stars](https://img.shields.io/github/stars/infinum/eightshift-frontend-libs-tailwind.svg?style=for-the-badge&label=Stars)](https://github.com/infinum/eightshift-frontend-libs-tailwind/) [![license](https://img.shields.io/github/license/infinum/eightshift-frontend-libs-tailwind.svg?style=for-the-badge)](https://github.com/infinum/eightshift-frontend-libs-tailwind/)

# 八相间前端放出尾风

这个图书馆是为了给你带来现代的前端开发工具 [八班波列尔普拉特](https://github.com/infinum/eightshift-boilerplate) 或者说 [八班波来尔普拉特插件](https://github.com/infinum/eightshift-boilerplate-plugin),但您可以在 WordPress 任何项目中使用.

## 文档

**完整文件请检查 [链接](https://eightshift.com/)。 。 。 .**

## 尾风类起伏

两个工具检查课程 与您的项目自己的 Tailwind 条目: 牛林为JS,和 `tw-sweep` 用于块列表和PHP。 两人都读出一个忽略列表.

1.  添加 `oxlint` 到您的项目 `devDependencies`隔离装置(pnpm, `bun --linker isolated`)不要曝光此包的二进制.
    
2.  创建 `oxlint.config.ts`数字 :
    
    ```ts
    import { defineConfig } from 'oxlint';
    import { createOxlintConfig } from '@eightshift/frontend-libs-tailwind/linters/oxlint.config.mjs';
    
    export default defineConfig(createOxlintConfig({ entryPoint: 'tailwind.css' }));
    ```
    
3.  创建 `tw-ignore.json` 非 Tailwind 工具的类(JS钩、BEM选择器、其他设计系统前缀)。 它是一个JSON Regex字符串的阵列;一个无效的图案会阻止两种工具:
    
    ```json
    ["^es:", "^js-", "^my-block__"]
    ```
    
4.  接通剧本. 阶段不通过 shell 运行命令,所以使用数组代替 `&&`数字 :
    
    ```json
    "scripts": {
     "lintJs:oxlint": "oxlint",
     "lintTw": "tw-sweep",
     "test": "bun run lintJs && bun run lintJs:oxlint && bun run lintTw"
    },
    "lint-staged": {
     "*.js": ["bun lintJs", "bun lintJs:oxlint"],
     "src/Blocks/**/manifest.json": "tw-sweep",
     "src/**/*.php": "tw-sweep"
    }
    ```
    

`tw-sweep` \* 报告不明和非分类; `tw-sweep --write` 重写非咒语. PHP 读取静态 `class="…"` 属性和字符串参数 `tailwindClasses`, (中文(简体) ), `getTwPart`, (中文(简体) ), `getTwClasses`, (中文(简体) ), `clsx` 财务报告和审定财务报表 `classnames`。对于没有帮助者包装的类地图,如筛选器从过滤器返回,请标记代码:

```php
// tw-sweep-classes-start.
$selectors['field']['parts']['label'] = ['flex items-center text-body-sm'];
// tw-sweep-classes-end.
```

选中非数组密钥的标记之间的每个字符串字元 。 运行 `tw-sweep --help` 所有旗帜.

## 我和谁说话?

如果你有任何问题,请 [打开一个问题](https://github.com/infinum/eightshift-frontend-libs/issues) 我们会尽力及时回答你.

## 维护者

八班前端 Libs Tailwind 维护并赞助 [八班制](https://eightshift.com/) 财务报告和审定财务报表 [无穷](https://infinum.com/)。 。 。 .

## 许可证

八相间前端放出尾风 [八班制](https://eightshift.com/) 财务报告和审定财务报表 [无穷](https://infinum.com/)。这是自由软件,可以根据 LICENSE 文件中规定的条件重新分配.

## 常见问题

### @eightshift/frontend-libs-tailwind 是什么？

由 Tailwind CSS 提供的以样式创建现代古腾堡主题的框架\.

### 如何安装 @eightshift/frontend-libs-tailwind？

在项目目录运行 npm install @eightshift/frontend-libs-tailwind，或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖：@eightshift/ui-components（^8\.0\.0）。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖，Yarn 需要手动安装。它还提供命令行工具 tw-sweep，可以用 npx tw-sweep 直接运行。

### @eightshift/frontend-libs-tailwind 支持 TypeScript 吗？

该包的 package\.json 没有声明类型入口。需要类型提示时，可以在 npm 上查找社区维护的 @types/eightshift\_\_frontend-libs-tailwind 是否存在。

### @eightshift/frontend-libs-tailwind 可以商用吗？

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

### @eightshift/frontend-libs-tailwind 的下载量有多少？

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

### @eightshift/frontend-libs-tailwind 还在维护吗？

最新版本 3\.5\.1 发布于 2026/11/11（2 天前）；至今共发布 44 个版本，其中过去 12 个月发布了 15 个；首次发布于 2024/07/01。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

