Loading...
Loading...
Guide for Tailwind CSS v4 patterns and best practices. Use when styling components with Tailwind CSS, creating responsive layouts, or working with Tailwind 4 features. Don't use for plain-CSS authoring, CSS-in-JS libraries (styled-components, emotion), or non-Tailwind utility frameworks.
npx skill4agent add marcioaltoe/skills tailwindcssbg-backgroundtext-foregroundbg-whitetext-blackbg-backgroundbg-cardbg-mutedbg-popovertext-foregroundtext-muted-foregroundtext-card-foregroundborder-borderborder-inputborder-ringbg-primary text-primary-foregroundbg-secondary text-secondary-foregroundbg-destructive text-destructive-foregroundbg-accent text-accent-foregroundbg-whitetext-blackborder-gray-200bg-blue-500const cardBaseClasses = [
"relative flex flex-col rounded-xl border border-border",
"bg-card text-card-foreground shadow-xs transition-colors duration-150",
];
// Usage: className={cardBaseClasses.join(' ')} or spread into cn()/clsx// Mobile-first responsive design
<div className="grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4">
// Container queries (built-in in v4)
<div className="@container">
<div className="@lg:flex @lg:items-center"><div className="size-10"> {/* Instead of w-10 h-10 */}
<div className="h-dvh"> {/* Dynamic viewport height */}
<div className="grid-cols-15"> {/* Dynamic grid columns */}
<h1 className="text-shadow-md"> {/* Text shadows */}
<div className="bg-(--custom-color)"> {/* CSS variables */}@apply!importantbg-${color}-500pnpm run lint