tailwindcss-responsive
Responsive design, breakpoints, container queries
When & Why to Use This Skill
This Claude skill provides a comprehensive reference and implementation guide for Tailwind CSS responsive design. It streamlines the development of adaptive web interfaces by offering precise syntax for default breakpoints, custom theme configurations, and the latest Container Queries (v4). By leveraging mobile-first principles and modern CSS techniques, it helps developers ensure consistent UI behavior across all device sizes.
Use Cases
- Implementing mobile-first responsive layouts using standard Tailwind breakpoints (sm, md, lg, xl, 2xl) to ensure cross-device compatibility.
- Configuring and applying custom breakpoints within the Tailwind CSS @theme to meet specific design system requirements.
- Utilizing Container Queries to create highly modular components that adapt their layout based on the size of their parent container rather than the entire viewport.
- Quickly referencing CSS media query equivalents for Tailwind utility classes to debug or optimize frontend styling.
| name | tailwindcss-responsive |
|---|---|
| description | Responsive design, breakpoints, container queries |
Responsive Design
Breakpoints par défaut
| Variant | Taille | CSS |
|---|---|---|
sm: |
40rem (640px) | @media (width >= 40rem) |
md: |
48rem (768px) | @media (width >= 48rem) |
lg: |
64rem (1024px) | @media (width >= 64rem) |
xl: |
80rem (1280px) | @media (width >= 80rem) |
2xl: |
96rem (1536px) | @media (width >= 96rem) |
Custom breakpoint
@theme {
--breakpoint-3xl: 120rem;
}
/* Usage: 3xl:grid-cols-6 */
Container Queries v4
<div class="@container">
<div class="@md:grid-cols-2 @lg:grid-cols-3">
<!-- Responsive au conteneur -->
</div>
</div>
Mobile-first
<div class="text-sm md:text-base lg:text-lg">
<!-- Petits écrans d'abord -->
</div>