tailwindcss-framework-integration — Claude Code skill
tailwindcss-framework-integration guides Tailwind CSS setup across React, Vite, Next.js, Vue, Nuxt, and SvelteKit. Useful for configuring bundler plugins, dark mode, and framework class merging.
MIT 298 installs ★ 66 updated 2026-06-18
npx skills add JosiahSiegel/claude-plugin-marketplace --skill tailwindcss-framework-integration -a claude-codeWhat tailwindcss-framework-integration does
This skill provides concrete recipes for setting up modern Tailwind CSS in frontend projects. It covers Vite setups for React, Next.js App Router with Server Components, Vue 3, Nuxt 3, and SvelteKit. Configurations rely on direct @import "tailwindcss"; syntax, custom theme tokens inside @theme, and build tool plugins.
Each setup covers framework-specific mechanics like tailwind-merge class resolution and dark theme toggling via next-themes. For scoped styles in Vue single-file components, the instructions demonstrate referencing the main stylesheet using @reference.
Modern Tailwind workflows route through @tailwindcss/vite or @tailwindcss/postcss. Builds fail without them. Projects do not need a legacy tailwind.config.js when using these bundler plugins.
What it helps with
- configure Tailwind CSS with Vite or PostCSS plugins
- enable dark mode in Next.js using
next-themes - resolve class conflicts using
tailwind-merge - access Tailwind tokens inside Vue scoped style blocks
- integrate Tailwind styles into React Server Components
Example prompts for the agent
- Set up Tailwind CSS in a Next.js App Router project with dark mode support
- Configure Tailwind for Vue 3 and Vite using @reference in scoped styles
- Show how to handle class merging with tailwind-merge in a React component
How to install tailwindcss-framework-integration
1Skills CLI (Vercel)
npx skills add JosiahSiegel/claude-plugin-marketplace --skill tailwindcss-framework-integration -a claude-code2Manually: put the files in place
~/.claude/skills/tailwindcss-framework-integration/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/tailwindcss-framework-integration/
1Skills CLI (Vercel)
npx skills add JosiahSiegel/claude-plugin-marketplace --skill tailwindcss-framework-integration -a codex2Manually: put the files in place
.agents/skills/tailwindcss-framework-integration/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add JosiahSiegel/claude-plugin-marketplace --skill tailwindcss-framework-integration -a cursor2Manually: put the files in place
.cursor/skills/tailwindcss-framework-integration/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install JosiahSiegel/claude-plugin-marketplace plugins/tailwindcss-master/skills/tailwindcss-framework-integration2Manually: put the files in place
.github/skills/tailwindcss-framework-integration/SKILL.md1Skills CLI (Vercel)
npx skills add JosiahSiegel/claude-plugin-marketplace --skill tailwindcss-framework-integration -a gemini-cli2Platform CLI
gemini skills install https://github.com/JosiahSiegel/claude-plugin-marketplace --path plugins/tailwindcss-master/skills/tailwindcss-framework-integrationManually: put the files in place
.devin/skills/tailwindcss-framework-integration/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add JosiahSiegel/claude-plugin-marketplace --skill tailwindcss-framework-integration -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about tailwindcss-framework-integration
How do I install tailwindcss-framework-integration in Claude Code?
Run npx skills add JosiahSiegel/claude-plugin-marketplace --skill tailwindcss-framework-integration -a claude-code. You can also save the definition directly into ~/.claude/skills/tailwindcss-framework-integration/SKILL.md.
Which frameworks does this skill cover?
It includes integration instructions for React (Vite, CRA), Next.js, Vue 3, Nuxt 3, SvelteKit, Angular, Astro, and Remix.
Does this setup require a separate tailwind.config.js file?
No, the skill relies on bundler plugins like @tailwindcss/vite and @tailwindcss/postcss, declaring theme tokens via @theme directly in CSS.
Source text
SKILL.md · MIT
---
name: tailwindcss-framework-integration
description: |
Tailwind CSS integration with React, Vue, Next.js, Svelte, Angular, and other frameworks.
PROACTIVELY activate for: (1) Tailwind in React (Vite, CRA), (2) Tailwind in Next.js (App Router, Pages Router), (3) Tailwind in Vue 3 / Nuxt, (4) Tailwind in SvelteKit, (5) Tailwind in Angular, (6) Tailwind in Astro, (7) Tailwind in Remix / React Router 7, (8) PostCSS vs CLI vs Vite plugin setup, (9) class merging utilities (tailwind-merge) per framework, (10) SSR-safe class composition.
Provides: per-framework setup steps, content config per framework, dark-mode setup, and class-merging recipes.
---
# Tailwind CSS Framework Integration
## React with Vite
### Setup
```bash
# Create React + Vite project
npm create vite@latest my-app -- --template react-ts
cd my-app
# Install Tailwind CSS
npm install -D tailwindcss @tailwindcss/vite
```
### Configuration
```javascript
// vite.config.ts
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import tailwindcss from '@tailwindcss/vite'
export default defineConfig({
plugins: [react(), tailwindcss()]
})
```
```css
/* src/index.css */
@import "tailwindcss";
```
```tsx
// src/main.tsx
import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './App'
import './index.css'
ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<App />
</React.StrictMode>
)
```
### Component Example
```tsx
// src/components/Button.tsx
interface ButtonProps {
variant?: 'primary' | 'secondary' | 'outline'
size?: 'sm' | 'md' | 'lg'
children: React.ReactNode
onClick?: () => void
}
const variants = {
primary: 'bg-blue-600 text-white hover:bg-blue-700',
secondary: 'bg-gray-200 text-gray-900 hover:bg-gray-300',
outline: 'border-2 border-blue-600 text-blue-600 hover:bg-blue-50'
}
const sizes = {
sm: 'px-3 py-1.5 text-sm',
md: 'px-4 py-2 text-base',
lg: 'px-6 py-3 text-lg'
}
export function Button({
variant = 'primary',
size = 'md',
children,
onClick
}: ButtonProps) {
return (
<button
onClick={onClick}
className={`
inline-flex items-center justify-center
font-medium rounded-lg
transition-colors duration-200
focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2
disabled:opacity-50 disabled:cursor-not-allowed
${variants[variant]}
${sizes[size]}
`}
>
{children}
</button>
)
}
```
## Next.js
### Setup (App Router)
```bash
# Create Next.js project (Tailwind included by default)
npx create-next-app@latest my-app
cd my-app
```
If adding to existing project:
```bash
npm install -D tailwindcss @tailwindcss/postcss
```
### Configuration
```javascript
// postcss.config.mjs
export default {
plugins: {
'@tailwindcss/postcss': {}
}
}
```
```css
/* app/globals.css */
@import "tailwindcss";
@theme {
--color-primary: oklch(0.6 0.2 250);
}
```
```tsx
// app/layout.tsx
import './globals.css'
export default function RootLayout({
children
}: {
children: React.ReactNode
}) {
return (
<html lang="en">
<body className="bg-white dark:bg-gray-900">{children}</body>
</html>
)
}
```
### Server Components
Tailwind works seamlessly with React Server Components:
```tsx
// app/page.tsx (Server Component)
export default function Home() {
return (
<main className="container mx-auto px-4 py-8">
<h1 className="text-4xl font-bold text-gray-900 dark:text-white">
Welcome
</h1>
<p className="mt-4 text-gray-600 dark:text-gray-300">
Server-rendered with Tailwind
</p>
</main>
)
}
```
### Dark Mode with next-themes
```bash
npm install next-themes
```
```tsx
// app/providers.tsx
'use client'
import { ThemeProvider } from 'next-themes'
export function Providers({ children }: { children: React.ReactNode }) {
return (
<ThemeProvider attribute="class" defaultTheme="system" enableSystem>
{children}
</ThemeProvider>
)
}
```
```tsx
// app/layout.tsx
import { Providers } from './providers'
import './globals.css'
export default function RootLayout({
children
}: {
children: React.ReactNode
}) {
return (
<html lang="en" suppressHydrationWarning>
<body>
<Providers>{children}</Providers>
</body>
</html>
)
}
```
```css
/* globals.css - Add dark mode variant */
@import "tailwindcss";
@custom-variant dark (&:where(.dark, .dark *));
```
## Vue 3
### Setup with Vite
```bash
npm create vue@latest my-app
cd my-app
npm install -D tailwindcss @tailwindcss/vite
```
### Configuration
```javascript
// vite.config.ts
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import tailwindcss from '@tailwindcss/vite'
export default defineConfig({
plugins: [vue(), tailwindcss()]
})
```
```css
/* src/assets/main.css */
@import "tailwindcss";
```
```typescript
// src/main.ts
import { createApp } from 'vue'
import App from './App.vue'
import './assets/main.css'
createApp(App).mount('#app')
```
### Component Example
```vue
<!-- src/components/Button.vue -->
<script setup lang="ts">
defineProps<{
variant?: 'primary' | 'secondary'
}>()
</script>
<template>
<button
class="px-4 py-2 rounded-lg font-medium transition-colors"
:class="{
'bg-blue-600 text-white hover:bg-blue-700': variant === 'primary',
'bg-gray-200 text-gray-900 hover:bg-gray-300': variant === 'secondary'
}"
>
<slot />
</button>
</template>
```
### Scoped Styles with @reference
```vue
<template>
<h1>Hello world!</h1>
</template>
<style scoped>
/* Reference global Tailwind definitions */
@reference "../../assets/main.css";
h1 {
@apply text-2xl font-bold text-blue-600;
}
</style>
```
### Alternative: CSS Variables
```vue
<template>
<h1>Hello world!</h1>
</template>
<style scoped>
h1 {
/* Use CSS variables directly - better performance */
font-size: var(--text-2xl);
font-weight: var(--font-bold);
color: var(--color-blue-600);
}
</style>
```
## Nuxt 3
### Setup
```bash
npx nuxi init my-app
cd my-app
npm install -D tailwindcss @tailwindcss/postcss
```
### Configuration
```javascript
// postcss.config.mjs
export default {
plugins: {
'@tailwindcss/postcss': {}
}
}
```
```css
/* assets/css/main.css */
@import "tailwindcss";
```
```typescript
// nuxt.config.ts
export default defineNuxtConfig({
css: ['~/assets/css/main.css']
})
```
## Svelte / SvelteKit
### Setup
```bash
npm create svelte@latest my-app
cd my-app
npm install -D tailwindcss @tailwindcss/vite
```
### Configuration
```javascript
// vite.config.js
import { sveltekit } from '@sveltejs/kit/vite'
import tailwindcss from '@tailwindcss/vite'
import { defineConfig } from 'vite'
export default defineConfig({
plugins: [sveltekit(), tailwindcss()]
})
```
```css
/* src/app.css */
@import "tailwindcss";
```
```svelte
<!-- src/routes/+layout.svelte -->
<script>
import '../app.css'
</script>
<slot />
```
### Component Example
```svelte
<!-- src/lib/Button.svelte -->
<script lang="ts">
export let variant: 'primary' | 'secondary' = 'primary'
</script>
<button
class="px-4 py-2 rounded-lg font-medium transition-colors
{variant === 'primary' ? 'bg-blue-600 text-white hover:bg-blue-700' : ''}
{variant === 'secondary' ? 'bg-gray-200 text-gray-900 hover:bg-gray-300' : ''}"
>
<slot />
</button>
```
## Astro
### Setup
```bash
npm create astro@latest my-app
cd my-app
npx astro add tailwind
```
### Manual Setup
```bash
npm install -D tailwindcss @tailwindcss/vite
```
```javascript
// astro.config.mjs
import { defineConfig } from 'astro/config'
import tailwindcss from '@tailwindcss/vite'
export default defineConfig({
vite: {
plugins: [tailwindcss()]
}
})
```
```css
/* src/styles/global.css */
@import "tailwindcss";
```
```astro
<!-- src/layouts/Layout.astro -->
---
import '../styles/global.css'
---
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>My Site</title>
</head>
<body class="bg-white dark:bg-gray-900">
<slot />
</body>
</html>
```
## Remix
### Setup
```bash
npx create-remix@latest my-app
cd my-app
npm install -D tailwindcss @tailwindcss/vite
```
### Configuration
```javascript
// vite.config.ts
import { vitePlugin as remix } from '@remix-run/dev'
import { defineConfig } from 'vite'
import tailwindcss from '@tailwindcss/vite'
export default defineConfig({
plugins: [remix(), tailwindcss()]
})
```
```css
/* app/tailwind.css */
@import "tailwindcss";
```
```tsx
// app/root.tsx
import stylesheet from './tailwind.css?url'
import { Links } from '@remix-run/react'
export const links = () => [
{ rel: 'stylesheet', href: stylesheet }
]
export default function App() {
return (
<html>
<head>
<Links />
</head>
<body className="bg-white dark:bg-gray-900">
<Outlet />
</body>
</html>
)
}
```
## Best Practices for All Frameworks
### 1. Use the Prettier Plugin
```bash
npm install -D prettier prettier-plugin-tailwindcss
```
```json
// .prettierrc
{
"plugins": ["prettier-plugin-tailwindcss"]
}
```
### 2. Install VS Code Extension
```bash
code --install-extension bradlc.vscode-tailwindcss
```
### 3. Create Reusable Components
Don't repeat long class strings—extract components:
```tsx
// Instead of repeating this everywhere:
<button className="px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors">
// Create a component:
<Button variant="primary">Click me</Button>
```
### 4. Use clsx or tailwind-merge for Conditional Classes
```bash
npm install clsx tailwind-merge
```
```tsx
import { clsx } from 'clsx'
import { twMerge } from 'tailwind-merge'
function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
}
// Usage
<div className={cn(
"base-class",
isActive && "active-class",
disabled && "opacity-50"
)} />
```
### 5. Configure Path Aliases
```json
// tsconfig.json
{
"compilerOptions": {
"paths": {
"@/*": ["./src/*"],
"@/components/*": ["./src/components/*"]
}
}
}
```
```tsx
import { Button } from '@/components/Button'
```
© JosiahSiegel · MIT · JosiahSiegel/claude-plugin-marketplace