# weapp-tailwindcss 文档索引 > Tailwind CSS 小程序适配方案,覆盖 uni-app、taro、rax、mpx、原生等场景的官方文档合集。 LLM 导航说明: - 顺序为「入门 → 配置 → API → 迁移/问题 → AI 工作流」,覆盖 webpack/vite/gulp 与各类小程序框架。 - 站点根为 https://tw.icebreaker.top,GitHub Pages 下为 /weapp-tailwindcss/ 前缀。 - 已剔除 MDX import 与重复标题,便于模型解析;附带保留的标题/描述 frontmatter。 ## Table of Contents - [简介](https://tw.icebreaker.top/intro.md): - [css 中使用 @apply 警告问题](https://tw.icebreaker.top/issues/at-apply.md): 我们以 `vscode` 为例 - [默认盒模型(box-sizing)问题](https://tw.icebreaker.top/issues/box-sizing.md): `Tailwindcss` 默认会把所有的元素的盒模型,设置为 `border-box` - [CSS 变量失效问题](https://tw.icebreaker.top/issues/css-vars.md): 在使用 `taro` 或者 `uni-app` 中,可能你会遇到 `CSS` 变量失效问题 - [组件外部样式类(externalClasses)的支持](https://tw.icebreaker.top/issues/externalClasses.md): 自定义组件使用 externalClasses 时 tailwindcss 样式拆分的问题与解决方案。 - [Tailwindcss 格式化](https://tw.icebreaker.top/issues/format.md): > 这是官方提供的包, - [group 和 peer 使用限制](https://tw.icebreaker.top/issues/group-and-peer.md): 在 `tailwindcss` 中,我们常常会这样写: - [常见问题](https://tw.icebreaker.top/issues/index.md): :::info 组件外部样式类必读 - [写在 js 中的 tailwindcss 任意值失效](https://tw.icebreaker.top/issues/js-string-invalid.md): `weapp-tailwindcss` 是允许你在 `js` 中编写任意值的,而且 `weapp-tailwindcss` 会自动帮你做好任意值的转译。 - [在 monorepo 中使用](https://tw.icebreaker.top/issues/monorepo.md): 在 `monorepo` 由于存在 `hoist` 机制,可能会导致 `weapp-tailwindcss` 和 `tailwindcss` 通信受阻,这时候需要显式的去指定 `tailwindcss` 的路径 - [生成样式只作用于view和text标签](https://tw.icebreaker.top/issues/more-tags.md): 在微信小程序中,`darkMode` 设置为 `class`/ `selector` 后,`dark:className` 类选择器在 `button` 上无效,看生成样式只作用于 `view` 和 `text` 标签 - [原生头条小程序使用 TailWindCSS](https://tw.icebreaker.top/issues/native-toutiao.md): > 以下内容由使用 `weapp-tailwindcss` 的热心网友提供,十分感谢! - [rpx 任意值颜色或长度单位二义性与解决方案](https://tw.icebreaker.top/issues/rpx-ambiguities.md): 在不使用 `weapp-tailwindcss` 的情况下,你直接写这样的 `rpx` 写法: - [`Tarojs` 中使用 `terser` 压缩代码](https://tw.icebreaker.top/issues/taro-terser.md): 在 `taro` `webpack5` 环境下,这个插件和外置额外安装的 `terser-webpack-plugin` 一起使用,会导致插件转义功能失效 - [H5 端原生 toast 样式偏移问题](https://tw.icebreaker.top/issues/toast-svg-bug.md): 在使用 `tailwindcss` 的时候,编译到 `h5` 平台,使用 `uni.toast` / `taro.toast` 时,出现下列的效果 - [和 NutUI 一起使用](https://tw.icebreaker.top/issues/use-with-nutui.md): `taro` 使用 [NutUI](https://nutui.jd.com) 的 `vue` 和 `react` 版本的共同注意点: - [和 Taroify 一起使用](https://tw.icebreaker.top/issues/use-with-taroify.md): `taro` 使用 [Taroify](https://taroify.github.io/taroify.com/) 的共同注意点: - [和 wot-design-uni 一起使用](https://tw.icebreaker.top/issues/use-with-wot-design-uni.md): 和 wot-design-uni 一起使用 - [v1 版本插件常见问题,使用最新版本插件无须参考](https://tw.icebreaker.top/issues/v1.md): 详见 [issue#28](https://github.com/sonofmagic/weapp-tailwindcss-webpack-plugin/issues/28) - [AI 编程助手落地实施方案](https://tw.icebreaker.top/ai/ai-coding-deployment-guide.md): > 你会得到:一套“能拍板、能试点、能复制”的落地方法(可治理、可控成本、可降级、可回滚)。\ - [AI 编码助手五大方案选型指南](https://tw.icebreaker.top/ai/ai-coding-three-solutions.md): 深度对比 Cursor IDE、GitHub Copilot、Claude Code、OpenAI Codex 和 AWS Kiro 五大 AI 编程方案的价格、额度和适用场景 - [AI 共有的不足和缺陷](https://tw.icebreaker.top/ai/ai-limitations.md): - 训练数据不可追溯:来源不透明,更新不可再现,难以审计和监管(例:医疗对话数据混入论坛内容,错误建议无法追责)。 - [AI 编程方案选型指南](https://tw.icebreaker.top/ai/ai-programming-plan.md): 国际与国产 AI 编程平台、IDE 和插件的能力与订阅方案对比,附预算与场景化选型建议。 - [AI Agent(智能体)](https://tw.icebreaker.top/ai/basics/agent.md): **AI Agent(人工智能智能体)** 是一个能够**自主感知环境、做出决策并执行行动**的 AI 系统。与传统的聊天式 AI 不同,Agent 可以: - [AI 沙箱(Sandbox)](https://tw.icebreaker.top/ai/basics/ai-sandbox.md): **AI 沙箱** 是一个**隔离的执行环境**,用于安全地运行 AI 生成的代码、执行命令或进行实验。沙箱确保 AI 操作不会影响宿主系统,同时提供可控的测试环境。 - [上下文窗口(Context Window)](https://tw.icebreaker.top/ai/basics/context-window.md): **上下文窗口 (Context Window)** 是大语言模型在单次对话中**能够记忆和处理的最大 Token 数量**。它决定了模型能"看到"和"理解"多少信息。 - [LLMs.txt(LLM 友好文档)](https://tw.icebreaker.top/ai/basics/llms-txt.md): **llms.txt** 是一个项目根目录下的文本文件,用于为**大语言模型(LLM)提供项目上下文**。它类似于 `README.md`,但专门为 AI 工具(如 Claude Code、Cursor、Cline)设计,帮助 AI 更好地理解和操作代码库。 - [MCP (Model Context Protocol)](https://tw.icebreaker.top/ai/basics/mcp.md): **MCP (Model Context Protocol)** 是一个开放协议,用于连接 AI 助手与系统上下文(数据源、工具、环境)。它由 Anthropic 于 2024 年 11 月发布,旨在解决 AI 应用与外部系统集成的标准化问题。 - [Power(规范驱动编程)](https://tw.icebreaker.top/ai/basics/power.md): **Power** 是由 **Kiro** 提出的一个概念,用于衡量 **AI 工具理解复杂规范并生成符合规范代码的能力**。在 Spec-Driven Development(规范驱动开发)的语境下,Power 指的是 AI 将非结构化的需求描述转换为结构化的技术规范,并最终生成可执行代码的能力。 - [Prompt Engineering(提示词工程)](https://tw.icebreaker.top/ai/basics/prompt-engineering.md): **Prompt(提示词)** 是用户输入给大语言模型的**指令或问题**。**Prompt Engineering(提示词工程)** 是设计和优化提示词以获得更好输出结果的技术。 - [RAG(检索增强生成)](https://tw.icebreaker.top/ai/basics/rag.md): **RAG (Retrieval-Augmented Generation)** 是一种结合了**信息检索(Retrieval)**和**生成式AI(Generation)**的技术架构。它让大语言模型在生成回答时,能够先从外部知识库中检索相关信息,然后基于检索到的内容生成更准确、更及时的回答。 - [Skill(技能系统)](https://tw.icebreaker.top/ai/basics/skill.md): **Skill** 是 Claude Code CLI 的**插件/技能系统**,允许开发者扩展 AI 助手的能力。每个 Skill 是一个独立的 npm 包,可以添加特定的功能、工作流或集成。 - [Spec-Driven Development(规范驱动开发)](https://tw.icebreaker.top/ai/basics/spec-driven-development.md): **Spec-Driven Development (SDD)** 或 **Spec-Driven Coding** 是一种**以规范(Specification)为先导**的软件开发方法论。开发者先编写详细的需求规范,然后由 AI 根据规范自动生成代码。 - [Token(词元)](https://tw.icebreaker.top/ai/basics/token.md): **Token** 是大语言模型(LLM)处理文本的**基本单位**。不同于人类理解的"单词"或"字符",Token 是模型内部使用的最小语义单元。 - [Vibe Coding(直觉编程)](https://tw.icebreaker.top/ai/basics/vibe-coding.md): **Vibe Coding**(直觉编程、感觉编程)是一种**依赖直觉、经验和即时反馈**的编程方式。开发者不严格遵循规范或计划,而是根据"感觉"来编写和调整代码。 - [AI 生成小程序代码](https://tw.icebreaker.top/ai/index.md): 本页面为使用 AI 快速构建小程序的专题,希望能够帮助大家不断的提升自己的开发效率 - [国外顶尖编程模型选型建议书](https://tw.icebreaker.top/ai/international-ai-models-comparison.md): > **核心结论**:在三大国外顶尖模型中,**Claude Opus 4.5** 在代码质量上保持领先,**GPT-5.2** 在数学推理上最强,**Gemini 3 Pro** 在多模态和长上下文场景表现突出。 - [LLM 友好文档 (llms.txt)](https://tw.icebreaker.top/ai/llms.md): 1. 在仓库根目录执行 `pnpm --filter @weapp-tailwindcss/website build`(或 `cd website && pnpm build`)。 - [AI 编程工具选型建议书](https://tw.icebreaker.top/ai/qoder-vs-glm47-cursor-claude-comparison.md): > **核心结论**:推荐以 **GLM-4.7** 为核心模型,配合 **Claude Code CLI** 构建 AI 工程化能力。 - [At Property](https://tw.icebreaker.top/at-property.md): 在 CSS 里,`@property` 是一个 **注册自定义属性(CSS Custom Properties)** 的新特性,它解决了原先 `--var: value` 那种“纯字符串变量”的一些缺陷。它主要提供了 **类型约束、初始值、继承控制** 等能力,让浏览器能更高效地处理这些变量,... - [咨询与定制服务](https://tw.icebreaker.top/community/consult.md): 国内像我这种开源,大部分都是为爱发电,除了个别朋友零星的打赏之外就再也没有人赞助了,当然打赏的钱也非常少,总的打赏金额比我一天的工资少多了。 - [加入技术交流群](https://tw.icebreaker.top/community/group.md): 如果你在使用中遇到什么问题,也欢迎你进入交流群进行提问。 - [加载自定义字体](https://tw.icebreaker.top/community/load-font.md): 详见: https://github.com/sonofmagic/weapp-tailwindcss/discussions/637 - [cva 与 tailwind-variants 支持](https://tw.icebreaker.top/community/merge/cva-and-variants.md): 使用 weapp-tailwindcss runtime 系列(@weapp-tailwindcss/cva 与 @weapp-tailwindcss/variants)内置的 cva()、tv() 等工具,快速封装跨端组件。 - [集成与排障指南](https://tw.icebreaker.top/community/merge/integration.md): 在真实项目中集成 @weapp-tailwindcss/merge 的注意事项,以及针对不同打包器的调试技巧。 - [概览](https://tw.icebreaker.top/community/merge/overview.md): @weapp-tailwindcss/merge 的定位、安装方式、快速上手示例以及多端项目的常见用法。 - [运行时 API](https://tw.icebreaker.top/community/merge/runtime-api.md): shared runtime —— @weapp-tailwindcss/runtime 以及 merge 系列在小程序里的用法。 - [适配的 `tailwindcss` 插件](https://tw.icebreaker.top/community/plugins.md): 虽然,相当一部分 `tailwindcss` 插件,都可以直接在 `weapp-tailwindcss` 里使用了。 - [🔥各个框架的模板](https://tw.icebreaker.top/community/templates.md): import TemplateLink from '@site/src/components/TemplateLink' - [@weapp-tailwindcss/typography](https://tw.icebreaker.top/community/typography.md): 小程序 `@tailwindcss/typography` 富文本渲染方案 - [生态以及解决方案](https://tw.icebreaker.top/community.md): - [版权信息](https://tw.icebreaker.top/copyright.md):