/astro:astro-tailwindfrom astro
Provides Tailwind CSS 4 patterns for Astro projects, including CSS-first config via `@theme`, responsive layouts, typography plugin, dark mode, and utility classes for common UI components.
Ships in astro. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Patterns for utility-first CSS in Astro projects.
npm install tailwindcss @tailwindcss/vite
astro.config.mjs:
import { defineConfig } from 'astro/config';
import tailwindcss from '@tailwindcss/vite';
export default defineConfig({
vite: {
plugins: [tailwindcss()],
},
});
Tailwind 4 is CSS-first: tokens are declared in the stylesheet with @theme, there is no separate JavaScript config file.
src/styles/global.css:
@import "tailwindcss";
@plugin "@tailwindcss/typography";
@theme {
--color-primary: #FFD700;
--color-secondary: #FFC000;
--color-dark: #1A1A1A;
--font-sans: 'Inter Variable', system-ui, sans-serif;
}
Import that stylesheet once, from a layout:
---
import '../styles/global.css';
---
<main class="min-h-screen bg-gray-50">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
<slot />
</div>
</main>
<article class="prose prose-lg prose-gray max-w-none">
<Content />
</article>
When building navigation headers, cards, buttons, forms, or grid layouts, read
references/ui-patterns.mdfor complete Tailwind component patterns.
When configuring the typography plugin or dark mode, read
references/ui-patterns.mdfor prose customization and dark mode setup.
| Prefix | Min Width |
|---|---|
sm: | 640px |
md: | 768px |
lg: | 1024px |
xl: | 1280px |
2xl: | 1536px |
| Pattern | Classes |
|---|---|
| Center content | mx-auto max-w-7xl |
| Flex center | flex items-center justify-center |
| Sticky header | sticky top-0 z-50 |
| Card shadow | shadow-lg hover:shadow-xl transition-shadow |
| Truncate text | truncate or line-clamp-2 |
| Glass effect | bg-white/80 backdrop-blur-sm |
| Focus ring | focus:ring-2 focus:ring-primary focus:outline-none |
| Gradient text | bg-gradient-to-r from-blue-600 to-purple-600 bg-clip-text text-transparent |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
tailwind-css, astro, css-utilities, responsive-design, theme-config
Other plugins' skills for the same job
npx claudepluginhub fabiensalles/claude-marketplace --plugin astro11 skills in this plugin
/astro-basicsACTIVATE when creating Astro components, layouts, pages, or setting up Astro project structure. ACTIVATE for 'Astro component', 'slot', 'layout', 'Astro.props', 'class:list'. Covers: component anatomy (frontmatter/template/style/script), layout pattern with slot, props patterns, scoped vs global styles, script patterns (build-time vs client-side), path aliases. DO NOT use for: content collections (see astro-content-collections), routing (see astro-routing), React islands (see astro-react)./astro-content-collectionsACTIVATE when working with Astro content collections, markdown/MDX files, YAML frontmatter, Zod schemas for content, or content-driven pages. ACTIVATE for 'getCollection', 'getEntry', 'defineCollection', 'content collection', 'content.config.ts'. Covers: collection schema definition with Zod, loader-based collections, querying/filtering collections, dynamic routes with getStaticPaths, YAML meta files, MDX with components, collection references. DO NOT use for: routing logic (see astro-routing), general Astro components (see astro-basics)./astro-envACTIVATE when working with environment variables, feature flags, or runtime configuration in Astro. ACTIVATE for 'import.meta.env', '.env', 'PUBLIC_', 'feature flag'. Covers: server vs client variables (PUBLIC_ prefix), feature flags pattern with centralized config, TypeScript env declarations, build-time vs runtime variables, Netlify/Vercel deployment vars. DO NOT use for: general Astro setup, content configuration.