# Tailwind CSS Configuration ## CSS-First Configuration (v4.1+) Use the `@theme` directive for CSS-based configuration: ```css /* src/styles.css */ @import "tailwindcss"; @theme { /* Custom colors */ --color-brand-50: #f0f9ff; --color-brand-500: #3b82f6; --color-brand-900: #1e3a8a; /* Custom fonts */ --font-display: "Inter", system-ui, sans-serif; --font-mono: "Fira Code", monospace; /* Custom spacing */ --spacing-128: 32rem; /* Custom animations */ --animate-fade-in: fadeIn 0.5s ease-in-out; /* Custom breakpoints */ --breakpoint-3xl: 1920px; } /* Define custom animations */ @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } } /* Custom utilities */ @utility content-auto { content-visibility: auto; } ``` --- ## JavaScript Configuration (Legacy) ```javascript /** @type {import('tailwindcss').Config} */ export default { content: [ "./index.html", "./src/**/*.{js,ts,jsx,tsx,vue,svelte}", ], theme: { extend: { colors: { primary: { 50: '#f0f9ff', 500: '#3b82f6', 900: '#1e3a8a', }, }, fontFamily: { sans: ['Inter', 'system-ui', 'sans-serif'], }, spacing: { '128': '32rem', }, }, }, plugins: [], } ``` --- ## Vite Integration (v4.1+) ```javascript // vite.config.ts import { defineConfig } from 'vite' import tailwindcss from '@tailwindcss/vite' export default defineConfig({ plugins: [ tailwindcss(), ], }) ``` --- ## Advanced v4.1 Features ### Native CSS Custom Properties ```html