Token导航 LogoToken导航

Agent Skill · 前端设计

tailwind-css(Tailwind CSS 样式)

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

tailwind-css 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为操作浏览器;许可证信息还不明确,第三方扫描已通过,按安装量在前端设计类的 10,216 个 Skill 里排第 9,472。

总安装 214周安装 9GitHub Stars 4下载 75核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:tailwind-css(Tailwind CSS 样式)
来源仓库:https://github.com/paulrberg/dot-agents
仓库路径:skills/tailwind-css
安装命令:
npx skills add https://github.com/paulrberg/dot-agents --skill tailwind-css
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/paulrberg/dot-agents --skill tailwind-css

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

tailwind-css 用于辅助前端页面、组件和样式逻辑的开发与维护。适合在 Codex、Claude、Cursor、Gemini CLI 中生成或审查 React、Next.js 相关代码。通过 npx 命令从指定仓库安装,需结合原始 README 确认具体用法。

使用时需结合项目现有设计系统和构建方式,避免生成孤立片段。建议优先参考来源仓库中的 SKILL.md 获取准确功能说明。

来源仓库内路径:skills/tailwind-css

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/paulrberg/dot-agents --skill tailwind-css;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要操作浏览器,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

tailwind-css 怎么安装?

在终端执行 npx skills add https://github.com/paulrberg/dot-agents --skill tailwind-css。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

tailwind-css 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

tailwind-css 需要什么权限?

权限级别是操作浏览器。该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

tailwind-css 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

tailwind-css 用的人多吗?

公开数据是累计安装 214 次,近一周安装 9 次,下载 75 次,GitHub 4 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

tailwind-css 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理前端设计类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

前端设计类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
frontend-design

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
tailwind-css

Tailwind CSS 样式 · 本页

2144操作浏览器未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Tailwind CSS v4

Expert guidance for Tailwind CSS v4, CSS-first configuration, modern utility patterns, and type-safe component styling with tailwind-variants.

CSS-First Configuration

Tailwind CSS v4 eliminates tailwind.config.ts in favor of CSS-only configuration. All configuration lives in CSS files using special directives.

Core Directives:

  • @import "tailwindcss" - Entry point that loads Tailwind
  • @theme {} - Define or extend design tokens
  • @theme static {} - Define tokens that should not generate utilities
  • @utility - Create custom utilities
  • @custom-variant - Define custom variants

Minimal Example:

@import "tailwindcss";

@theme {
  --color-brand: oklch(0.72 0.11 178);
  --font-display: "Inter", sans-serif;
  --spacing-edge: 1.5rem;
}

All theme tokens defined with @theme automatically become available as utility classes. For example, --color-brand can be used as bg-brand, text-brand, border-brand, etc.

ESLint Integration

Use eslint-plugin-better-tailwindcss for Tailwind CSS v4 class validation and style enforcement.

Correctness Rules (errors):

  • no-conflicting-classes - Detect classes that override each other
  • no-unknown-classes - Flag classes not registered with Tailwind

Stylistic Rules (warnings):

  • enforce-canonical-classes - Use standard v4 class names
  • enforce-shorthand-classes - Use abbreviated class versions
  • no-deprecated-classes - Remove outdated class names
  • no-duplicate-classes - Eliminate redundant declarations
  • no-unnecessary-whitespace - Clean up extra spacing

Examples:

// ❌ Bad: separate padding
<div className="px-6 py-6">

// ✅ Good: shorthand
<div className="p-6">
// ❌ Bad: separate width/height
<div className="w-6 h-6">

// ✅ Good: size utility
<div className="size-6">

Run the project's ESLint check after modifying Tailwind classes to validate all changes across the codebase.

Coding Preferences

Layout and Spacing

Use gap for flex/grid spacing, not space-x/space-y:

The gap utilities handle wrapping correctly, while space-* utilities break when flex/grid items wrap to multiple lines.

// ✅ Good: gap handles wrapping
<div className="flex gap-4">

// ❌ Bad: breaks when items wrap
<div className="flex space-x-4">

**Prefer size-* over separate w-*/h-* for equal dimensions:**

// ✅ Good: concise
<div className="size-16">

// ❌ Bad: redundant
<div className="w-16 h-16">

Always use min-h-dvh instead of min-h-screen:

Dynamic viewport height (dvh) accounts for mobile browser chrome, while vh units ignore it and cause layout issues on mobile Safari.

// ✅ Good: works on mobile Safari
<main className="min-h-dvh">

// ❌ Bad: buggy on mobile Safari
<main className="min-h-screen">

Prefer top/left margins over bottom/right:

Consistent directionality improves layout predictability.

// ✅ Good: top margin
<div className="mt-4">

// ❌ Avoid: bottom margin (unless needed)
<div className="mb-4">

Use padding on parent containers instead of bottom margins on last child:

Padding provides consistent spacing without needing :last-child selectors.

// ✅ Good: padding on parent
<section className="pb-8">
  <div>Item 1</div>
  <div>Item 2</div>
  <div>Item 3</div>
</section>

// ❌ Avoid: margin on children
<section>
  <div className="mb-4">Item 1</div>
  <div className="mb-4">Item 2</div>
  <div>Item 3</div>
</section>

For max-widths, prefer container scale over pixel values:

// ✅ Good: semantic container size
<div className="max-w-2xl">

// ❌ Avoid: arbitrary pixel value
<div className="max-w-[672px]">

Typography

**Avoid leading-* classes; use line height modifiers:**

Tailwind v4 supports inline line height modifiers with the text-{size}/{leading} syntax.

// ✅ Good: combined size and line height
<p className="text-base/7">

// ❌ Bad: separate utilities
<p className="text-base leading-7">

Font Size Reference:

ClassSize
text-xs12px
text-sm14px
text-base16px
text-lg18px
text-xl20px

Colors and Opacity

Use opacity modifier syntax, not separate opacity utilities:

All *-opacity-* utilities were removed in Tailwind v4. Use the modifier syntax instead.

// ✅ Good: opacity modifier
<div className="bg-red-500/60">

// ❌ Bad: removed in v4
<div className="bg-red-500 bg-opacity-60">

Prefer design tokens over arbitrary hex values:

Check the project's @theme configuration before using arbitrary color values.

// ✅ Good: theme token
<div className="bg-brand">

// ❌ Avoid: arbitrary hex (check theme first)
<div className="bg-[#4f46e5]">

Border Radius

Tailwind v4 renamed border radius utilities:

v3v4 (equivalent)Size
rounded-smrounded-xs2px
roundedrounded-sm4px
rounded-mdrounded6px
rounded-lgrounded-md8px

Use the v4 names when writing new code.

Gradients

Tailwind v4 renamed gradient utilities and added new gradient types.

**Use bg-linear-*, not bg-gradient-*:**

// ✅ Good: v4 syntax
<div className="bg-linear-to-r from-blue-500 to-purple-500">

// ❌ Bad: removed in v4
<div className="bg-gradient-to-r from-blue-500 to-purple-500">

New gradient types:

  • bg-radial - Radial gradients
  • bg-conic - Conic gradients

Example:

<div className="bg-radial from-blue-500 to-purple-500">
<div className="bg-conic from-red-500 via-yellow-500 to-green-500">

Arbitrary Values

Always prefer Tailwind's predefined scale:

Check the project's @theme configuration for available tokens before using arbitrary values.

// ✅ Good: predefined scale
<div className="ml-4">

// ❌ Avoid: arbitrary pixel value
<div className="ml-[16px]">

General rule: Prefer sizing scale over pixel values. Three similar lines of code is better than a premature abstraction.

Class Merging

The common pattern is a cn utility combining clsx + tailwind-merge.

Use cn for:

  • Static constants: const CARD_BASE = cn("fixed classes")
  • Conditional classes: cn("base", condition && "conditional")
  • Dynamic merging: cn(baseClasses, className)
  • Conflict resolution: cn("p-4", "p-6") → "p-6"

Do NOT use cn for:

  • Static strings in className attributes: className="fixed classes"

Examples:

// ✅ Good: static string in className
<button className="rounded-lg px-4 py-2 font-medium bg-blue-600">

// ✅ Good: static constant with cn
const CARD_BASE = cn("rounded-lg border border-gray-300 p-4");
<div className={CARD_BASE} />

// ✅ Good: conditional with cn
<button className={cn(
  "rounded-lg px-4 py-2 font-medium",
  isActive ? "bg-blue-600" : "bg-gray-700",
  disabled && "opacity-50"
)} />

// ❌ Bad: unnecessary cn for static className attribute
<button className={cn("rounded-lg px-4 py-2 font-medium")} />

Image Sizing

Use Tailwind size classes instead of pixel values for Image components.

// ✅ Good: Tailwind units
<Image src={src} alt={alt} className="size-16" />
<Image src={src} alt={alt} className="w-24 h-auto" />

// ❌ Bad: pixel values
<Image src={src} alt={alt} width={64} height={64} />

Z-Index

Define z-index values as CSS custom properties in @theme, then reference them with the z-(--z-*) syntax.

Never use arbitrary z-index numbers:

// ✅ Good: theme z-index value
<div className="z-(--z-modal)">
<div className="z-(--z-sticky)">

// ❌ Bad: arbitrary z-index numbers
<div className="z-[100]">
<div className="z-[9999]">

Define z-index tokens in CSS:

@theme {
  --z-base: 0;
  --z-sticky: 10;
  --z-modal: 100;
  --z-tooltip: 1000;
}

Dark Mode

Use the plain dark: variant for dark mode styles.

Pattern:

Write light mode styles first, then add dark mode overrides.

// ✅ Good: light mode first, then dark override
<div className="bg-white text-gray-900 dark:bg-gray-900 dark:text-white">

// ❌ Avoid: dark mode first (less readable)
<div className="dark:bg-gray-900 dark:text-white bg-white text-gray-900">

CSS Modules

Use CSS Modules only as a last resort for complex CSS that cannot be easily written with Tailwind classes.

All .module.css files must include @reference "#tailwind"; at the top to enable Tailwind utilities and theme tokens inside the module.

Example:

/* component.module.css */
@reference "#tailwind";

.component {
  /* Complex CSS that can't be expressed with Tailwind utilities */
  /* Can still use Tailwind utilities and theme tokens */
}

Common Tasks

Adding a Component with Variants

  1. Read references/tailwind-variants.md for patterns
  2. Check the project's @theme configuration for available tokens
  3. Use tv() from tailwind-variants for type-safe variants

Example:

import { tv } from "tailwind-variants";

const button = tv({
  base: "rounded-lg px-4 py-2 font-medium",
  variants: {
    color: {
      primary: "bg-blue-600 text-white",
      secondary: "bg-gray-600 text-white",
    },
    size: {
      sm: "text-sm",
      md: "text-base",
      lg: "text-lg",
    },
  },
});

Debugging Styles

  1. Check references/tailwind-v4-rules.md for breaking changes
  2. Verify gradient syntax (bg-linear-*, not bg-gradient-*)
  3. Verify CSS variable syntax (bg-my-color, not bg-[--var-my-color])
  4. Check if arbitrary value exists in the project's @theme configuration

Working with Colors

  1. Check the project's @theme configuration first to see available colors
  2. Use semantic color names when available
  3. Use opacity modifiers for transparency (/20, /50, etc.)
  4. Avoid arbitrary colors unless absolutely necessary

Example:

// ✅ Good: theme token with opacity
<div className="bg-brand/20 text-brand">

// ❌ Avoid: arbitrary hex
<div className="bg-[#4f46e5]/20 text-[#4f46e5]">

Adding Animations

  1. Read references/tw-animate-css.md for available animations
  2. Combine a base class (animate-in or animate-out) with effect classes
  3. Note decimal spacing gotcha: use [0.625rem] syntax, not 2.5

Example:

// Enter: fade + slide up
<div className="fade-in slide-in-from-bottom-4 duration-300 animate-in">

// Exit: fade + slide down
<div className="fade-out slide-out-to-bottom-4 duration-200 animate-out">

Quick Reference Table

AspectPattern
ConfigurationCSS-only: @theme, @utility, @custom-variant
Gradientsbg-linear-*, bg-radial, bg-conic
OpacityModifier syntax: bg-black/50
Line HeightModifier syntax: text-base/7
Font Featuresfont-features-zero, font-features-ss01, etc.
CSS Variablesbg-my-color (auto-created from @theme)
CSS Modules@reference "#tailwind"; at top
Class Mergingcn() for conditionals; plain string for static
Viewportmin-h-dvh (not min-h-screen)
Component Variantsreferences/tailwind-variants.md
Animationsreferences/tw-animate-css.md
V4 Rulesreferences/tailwind-v4-rules.md

Reference Documentation

  • Tailwind v4 Rules & Best Practices: references/tailwind-v4-rules.md — Breaking changes, removed/renamed utilities, layout rules, typography, gradients, CSS variables, new v4 features, common pitfalls
  • tailwind-variants Patterns: references/tailwind-variants.md — Component variants, slots API, composition, TypeScript integration, responsive variants
  • tw-animate-css Reference: references/tw-animate-css.md — Enter/exit animations, slide/fade/zoom utilities, spacing gotchas

平台分布

Codex

34.41%
按下载量换算26

Claude

27.97%
按下载量换算21

Cursor

19.03%
按下载量换算14

Gemini CLI

10.49%
按下载量换算8

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills