| name | tailwindcss-v4-styling |
| description | Style with TailwindCSS v4 using @theme directive for theming, responsive design, and dark mode. Use when defining custom colors/fonts, implementing responsive layouts, or adding utility classes. |
TailwindCSS v4 Styling
Styling guide for TailwindCSS v4 with CSS-first configuration and @theme directive.
When to Use This Skill
- Styling components and pages
- Defining custom themes (colors, fonts, spacing)
- Implementing responsive design
- Adding dark mode support
- Using utility-first CSS approach
When NOT to use:
- Logic implementation only →
angular-v21-development
- Page routing configuration →
analogjs-development
- UI/UX design patterns →
material-design-3-expressive
Core Principles
Implementation Guidelines
Theme Configuration
Define custom design tokens in CSS:
- Use
@theme { } block in src/styles.css
- Define CSS custom properties for colors, fonts, spacing
- TailwindCSS automatically generates utility classes from theme variables
- Use
oklch() color space for better color manipulation
→ Details: Theme Configuration
Responsive Design
Responsive layout patterns:
- Mobile-first approach: base styles for mobile
- Add breakpoint prefixes for larger screens:
md:, lg:, xl:, 2xl:
- Use responsive container classes
- Test across breakpoints
→ Details: Theme Configuration
Dark Mode
Dark mode implementation patterns:
- Use
prefers-color-scheme media query in @theme
- Override CSS custom properties for dark theme
- Use
dark: variant for component-level overrides
→ Details: Theme Configuration
Angular Integration
Patterns for using TailwindCSS with Angular:
- Use
[class] binding for conditional classes
- Use
[style] binding for dynamic styles
- Avoid
ngClass and ngStyle directives
- Keep styling in template, use component CSS for complex cases
→ Details: Theme Configuration
Layout Patterns
Common layout implementations:
- Flexbox utilities:
flex, justify-*, items-*, gap-*
- Grid utilities:
grid, grid-cols-*, col-span-*
- Container:
container mx-auto px-4
- Spacing:
p-*, m-*, space-*
→ Details: Theme Configuration
Workflow
- Design Analysis: Review design requirements and identify patterns
- Theme Setup: Define custom tokens in
@theme if needed
- Utility Styling: Apply utility classes directly in templates
- Responsive Adaptation: Add breakpoint prefixes for responsive behavior
- Interaction States: Add hover:, focus:, active: variants
- Dark Mode: Implement dark theme support if required
Related Skills
- angular-v21-development: For class binding integration
- material-design-3-expressive: For design token integration
- analogjs-development: For page styling
Reference Documentation
For detailed patterns and code examples, see: