← ClaudeAtlas

web-stylinglisted

Styling patterns for React web applications. Use when working with Tailwind CSS, CSS Modules, theming, responsive design, or component styling.
aiskillstore/marketplace · ★ 329 · Web & Frontend · score 79
Install: claude install-skill aiskillstore/marketplace
# Web Styling (React) ## Tailwind CSS ### Basic Usage ```typescript function Button({ variant = 'primary', children }) { const baseClasses = 'px-4 py-2 rounded-lg font-medium transition-colors'; const variants = { primary: 'bg-blue-600 text-white hover:bg-blue-700', secondary: 'bg-gray-200 text-gray-800 hover:bg-gray-300', danger: 'bg-red-600 text-white hover:bg-red-700', }; return ( <button className={`${baseClasses} ${variants[variant]}`}> {children} </button> ); } ``` ### Conditional Classes with clsx/cn ```typescript import { clsx } from 'clsx'; // or with tailwind-merge for deduplication import { twMerge } from 'tailwind-merge'; function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs)); } function Card({ isActive, isDisabled, className, children }) { return ( <div className={cn( 'p-4 rounded-lg border', isActive && 'border-blue-500 bg-blue-50', isDisabled && 'opacity-50 cursor-not-allowed', className // Allow overrides )} > {children} </div> ); } ``` ### Responsive Design ```typescript // Mobile-first breakpoints // sm: 640px, md: 768px, lg: 1024px, xl: 1280px, 2xl: 1536px <div className=" grid grid-cols-1 /* Mobile: 1 column */ sm:grid-cols-2 /* Tablet: 2 columns */ lg:grid-cols-3 /* Desktop: 3 columns */ xl:grid-cols-4 /* Large: 4 columns */ gap-4 "> {items.map(item => <Card key={item.id} {...item} />)} </div> // Respon