Loading...
Loading...
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 skill4agent add sablier-labs/agent-skills tailwind-css./references/TAILWIND_V4_RULES.md./references/TAILWIND_VARIANTS.md@apply--spacing()tailwind.config.ts@theme { }@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) |
|---|---|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| Deprecated | Replacement |
|---|---|
| Use opacity modifier: |
| Use opacity modifier: |
| Use opacity modifier: |
| |
| |
| |
<!-- 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! -->md:lg:sm:<!-- 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-dvhmin-h-screenmin-h-screensize-*<div class="w-10 h-10">...</div>
<!-- Verbose -->
<div class="size-10">...</div>
<!-- Preferred -->leading-*<!-- 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 -->.custom-element {
background: var(--color-red-500);
padding: var(--spacing-4);
border-radius: var(--radius-lg);
}--spacing().custom-class {
margin-top: calc(100vh - --spacing(16));
}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" });./references/TAILWIND_VARIANTS.mdextend| Topic | Pattern |
|---|---|
| Gradients | |
| Opacity | |
| Line height | |
| Spacing | Use |
| Equal size | |
| Full height | |
| Component variants | |
./references/TAILWIND_VARIANTS.mdtv()VariantProps<typeof component>./references/TAILWIND_V4_RULES.mdbg-linear-*bg-gradient-*bg-red-500/50bg-opacity-*