tailwind-4

安装量: 144
排名: #5942

安装

npx skills add https://github.com/prowler-cloud/prowler --skill tailwind-4

Styling Decision Tree Tailwind class exists? → className="..." Dynamic value? → style={{ width: ${x}% }} Conditional styles? → cn("base", condition && "variant") Static only? → className="..." (no cn() needed) Library can't use class?→ style prop with var() constants

Critical Rules Never Use var() in className // ❌ NEVER: var() in className

// ✅ ALWAYS: Use Tailwind semantic classes

Never Use Hex Colors // ❌ NEVER: Hex colors in className

// ✅ ALWAYS: Use Tailwind color classes

The cn() Utility import { clsx } from "clsx"; import { twMerge } from "tailwind-merge";

export function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs)); }

When to Use cn() // ✅ Conditional classes

// ✅ Merging with potential conflicts

返回排行榜