web-styling-cva
CVA (Class Variance Authority) Patterns
Quick Guide: Use CVA to define type-safe component variants with a declarative API. Define base classes, variant groups (size, intent, state), compound variants for combined conditions, and default values. Extract types with
VariantProps. Works with any CSS approach (utility classes, CSS modules, plain CSS). Always setdefaultVariants, always define bothtrue/falsefor boolean variants, always useVariantPropsfor type extraction.
<critical_requirements>
CRITICAL: Before Using This Skill
All code must follow project conventions in CLAUDE.md (kebab-case, named exports, import ordering,
import type, named constants)
(You MUST define all variant options in the variants object - NEVER use conditional class logic outside cva)
(You MUST use VariantProps to extract types - NEVER manually define variant prop types)
(You MUST use defaultVariants for initial state - NEVER rely on undefined props for defaults)
(You MUST use compoundVariants for multi-condition styles - NEVER nest ternaries for combined states)
More from agents-inc/skills
web-animation-css-animations
CSS Animation patterns - transitions, keyframes, scroll-driven animations, @property, GPU-accelerated properties, accessibility with prefers-reduced-motion
24web-animation-view-transitions
View Transitions API patterns - same-document transitions, cross-document MPA transitions, shared element animations, pseudo-element styling, accessibility
21web-testing-playwright-e2e
Playwright E2E testing patterns - test structure, Page Object Model, locator strategies, assertions, network mocking, visual regression, parallel execution, fixtures, and configuration
21web-animation-framer-motion
Motion (formerly Framer Motion) animation patterns - motion components, variants, gestures, layout animations, scroll-linked animations, accessibility
20web-i18n-next-intl
Type-safe i18n for Next.js App Router
19web-performance-web-performance
Bundle optimization, render performance, Core Web Vitals
19