skills/tailwind-css/SKILL.md
This skill should be used when the user asks about "Tailwind CSS", "tailwind-variants", "tv() function", "CSS-first configuration", "Tailwind breaking changes", mentions styling with Tailwind utilities, gradient syntax, or component variants with TypeScript.
npx skillsauth add sablier-labs/agent-skills tailwind-cssInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are an expert in Tailwind CSS v4. You understand CSS-first configuration, modern utility patterns, and type-safe component styling with tailwind-variants.
./references/tailwind-v4-rules.md
./references/tailwind-variants.md
@apply - Use CSS variables, the --spacing() function, or framework components insteadTailwind CSS v4 uses CSS-only configuration:
tailwind.config.ts file needed@theme { } or @theme static { }@utility { }@custom-variant { }@import "tailwindcss";
@theme {
--color-primary: oklch(0.72 0.11 178);
--spacing-edge: 1.5rem;
}
| v3 (deprecated) | v4 (use instead) |
| ------------------ | ------------------ |
| bg-gradient-* | bg-linear-* |
| shadow-sm | shadow-xs |
| shadow | shadow-sm |
| blur-sm | blur-xs |
| blur | blur-sm |
| rounded-sm | rounded-xs |
| rounded | rounded-sm |
| outline-none | outline-hidden |
| ring | ring-3 |
| drop-shadow-sm | drop-shadow-xs |
| drop-shadow | drop-shadow-sm |
| backdrop-blur-sm | backdrop-blur-xs |
| backdrop-blur | backdrop-blur-sm |
| Deprecated | Replacement |
| ------------------- | --------------------------------------- |
| bg-opacity-* | Use opacity modifier: bg-black/50 |
| text-opacity-* | Use opacity modifier: text-black/50 |
| border-opacity-* | Use opacity modifier: border-black/50 |
| flex-shrink-* | shrink-* |
| flex-grow-* | grow-* |
| overflow-ellipsis | text-ellipsis |
Use v4 gradient syntax:
<!-- Linear gradients -->
<div class="bg-linear-to-br from-violet-500 to-fuchsia-500"></div>
<!-- Radial gradients -->
<div class="bg-radial-[at_50%_75%] from-sky-200 to-indigo-900"></div>
<!-- Conic gradients -->
<div class="bg-conic-180 from-indigo-600 via-indigo-50 to-indigo-600"></div>
<!-- Deprecated syntax -->
<div class="bg-gradient-to-br ..."></div>
<!-- Wrong! -->
Tailwind is mobile-first:
md:, lg:) apply at that breakpoint and abovesm: for mobile - it's redundant<!-- Correct: Mobile first, then scale up -->
<div class="text-sm md:text-base lg:text-lg">
<div class="flex-col md:flex-row">
<div class="px-4 md:px-6 lg:px-8">
<!-- Hide on mobile, show on desktop -->
<div class="hidden lg:block"></div>
</div>
</div>
</div>
<!-- Don't use space utilities in flex/grid -->
<div class="flex space-x-4">...</div>
<!-- Wrong! -->
<!-- Use gap -->
<div class="flex gap-4">...</div>
<!-- Correct -->
min-h-dvh instead of min-h-screenmin-h-screen is buggy on mobile Safari.
size-* for equal width/height<div class="w-10 h-10">...</div>
<!-- Verbose -->
<div class="size-10">...</div>
<!-- Preferred -->
Use line-height modifiers, not leading-* classes:
<!-- Don't use separate leading classes -->
<p class="text-base leading-7">...</p>
<!-- Wrong! -->
<!-- Use line-height modifiers -->
<p class="text-base/7">...</p>
<!-- Correct -->
Tailwind v4 exposes theme values as CSS variables:
.custom-element {
background: var(--color-red-500);
padding: var(--spacing-4);
border-radius: var(--radius-lg);
}
Use --spacing() function for calculations:
.custom-class {
margin-top: calc(100vh - --spacing(16));
}
Type-safe component variants with automatic class conflict resolution:
import { tv, type VariantProps } from "tailwind-variants";
const button = tv({
base: "font-medium rounded-lg transition-colors",
variants: {
color: {
primary: "bg-blue-500 text-white hover:bg-blue-600",
secondary: "bg-gray-500 text-white hover:bg-gray-600"
},
size: {
sm: "text-sm px-3 py-1.5",
md: "text-base px-4 py-2",
lg: "text-lg px-6 py-3"
}
},
defaultVariants: {
color: "primary",
size: "md"
}
});
type ButtonVariants = VariantProps<typeof button>;
// Usage
button(); // Uses defaults
button({ color: "secondary", size: "lg" });
See ./references/tailwind-variants.md for:
extend| Topic | Pattern |
| ---------------------- | -------------------------------------- |
| Gradients | bg-linear-*, bg-radial, bg-conic |
| Opacity | bg-red-500/50 (not bg-opacity-*) |
| Line height | text-base/7 (not leading-*) |
| Spacing | Use gap-* in flex/grid |
| Equal size | size-10 (not w-10 h-10) |
| Full height | min-h-dvh (not min-h-screen) |
| Component variants | tv() from tailwind-variants |
Creating a component with variants:
./references/tailwind-variants.md for patternstv() for type-safe variantsVariantProps<typeof component>Debugging styles:
./references/tailwind-v4-rules.md for breaking changesbg-linear-*, not bg-gradient-*)bg-red-500/50, not bg-opacity-*)development
This skill should be used when the user asks to "create a state machine", "add xState", "use xState with React", "implement actor-based state", "manage complex state with state machines", "use xState with Effect", "integrate Effect-ts with xState", mentions xState hooks (useMachine, useActor, useSelector), or discusses finite state machines in React applications.
tools
This skill should be used when the user asks about "viem", "viem client", "viem actions", "TypeScript Ethereum", "createPublicClient", "createWalletClient", "parseEther", "formatEther", "readContract", "writeContract", or mentions using viem for blockchain interactions.
development
This skill should be used when the user asks to "analyze a screenshot", "generate implementation spec", "create SPEC.md from screenshot", "extract design specs", "spec from image", or provides website screenshots and wants detailed implementation guidance.
documentation
This skill should be used when writing content for Sablier, including "write a blog post", "create a case study", "draft a tweet", "write X/Twitter posts", "write an announcement", "create educational content", or any marketing content task for Sablier's brand.