plugins/tailwindcss/skills/tailwindcss-core/SKILL.md
Configuration and directives Tailwind CSS v4.1. @theme, @import, @source, @utility, @variant, @apply, @config. CSS-first mode without tailwind.config.js. Use when: configuring Tailwind CSS-first (no tailwind.config.js), defining theme tokens via @theme, scanning source files with @source, or creating custom utilities/variants. Do NOT use for: v3-to-v4 migration and breaking changes (use tailwindcss-v4), utility class lookup by category (use tailwindcss-layout/spacing/typography/backgrounds/borders/effects/sizing/interactivity/transforms).
npx skillsauth add fusengine/agents tailwindcss-coreInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Tailwind CSS v4.1 introduces a CSS-first approach that eliminates the need for a traditional tailwind.config.js file. All configuration is now done directly in your CSS files via specialized directives.
Entry point to load Tailwind CSS. Place at the beginning of your main CSS file.
@import "tailwindcss";
This directive automatically loads:
Directive to define or customize theme values via CSS custom properties.
@theme {
--color-primary: #3b82f6;
--color-secondary: #ef4444;
--spacing-custom: 2.5rem;
--radius-lg: 1rem;
}
Variables are accessible in generated utilities:
--color-* → classes bg-primary, text-primary, etc.--spacing-* → classes p-custom, m-custom, etc.--radius-* → classes rounded-lg, etc.Directive to include additional source files with glob patterns.
@source "./routes/**/*.{ts,tsx}";
@source "./components/**/*.{tsx,jsx}";
@source "../packages/ui/src/**/*.{ts,tsx}";
Tailwind will scan these files to generate utilities used in your project.
Directives to create custom utilities and variants.
@utility truncate {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
@variant group-hover {
.group:hover &
}
Directive to apply Tailwind classes in your custom CSS rules.
.btn {
@apply px-4 py-2 rounded-lg font-semibold;
}
.btn-primary {
@apply bg-blue-500 text-white hover:bg-blue-600;
}
Directive to load external configuration if needed.
@config "./tailwind.config.js";
(Optional in v4.1, mainly used for backward compatibility)
Dark mode configuration in Tailwind v4.1:
@import "tailwindcss";
/* Use system preference */
@variant dark (&:is(.dark *));
Or via manual class:
@variant dark (&.dark);
Breakpoints are defined via @theme:
@theme {
--breakpoint-sm: 640px;
--breakpoint-md: 768px;
--breakpoint-lg: 1024px;
--breakpoint-xl: 1280px;
--breakpoint-2xl: 1536px;
}
Responsive variants are used with utilities:
<div class="text-sm md:text-base lg:text-lg"></div>
@layer theme, base, components, utilities;
@import "tailwindcss";
/* Your customizations */
@layer components {
.btn { @apply px-4 py-2 rounded; }
}
@layer utilities {
.text-shadow { text-shadow: 0 2px 4px rgba(0,0,0,0.1); }
}
Load Tailwind plugins:
@import "tailwindcss";
@plugin "flowbite/plugin";
@source "../node_modules/flowbite";
In CSS-first, import and declaration order determines specificity:
@import "tailwindcss" - Base utilities@theme { ... } - Theme variables@layer components { ... } - Custom components@layer utilities { ... } - Custom utilitiesSee specific files for:
theme.md - Complete theme variable configurationdirectives.md - Syntax and examples of all directivesconfig.md - Advanced configuration and use casestesting
Copy self-audit and ban-lists — filler verbs/hype adjectives, slop placeholder names, fake-precise numbers, Title Case headlines, humor in error copy ('Oops!'), em-dash crutch, one copy register per page.
development
Logged-in web apps — dashboards, auth flows, settings, onboarding, data tables, command palettes, modals, toasts. Register `product`: density and glance-speed over marketing polish, no hero/CTA-tricks, every data surface covers empty/loading/error explicitly, tables and dataviz follow preattentive-processing rules.
development
Marketing sites, landing pages, campaign pages — register `brand` (design IS the product). Structure comes from the register's POV + a macrostructure pick, never from copying an inspiration site's section flow. Hero discipline, deviated section order, asymmetric grids, and a silhouette lookalike-test gate before ship.
development
Token-strategy core — OKLCH color rules, neutral tinting, accent-commitment levels, type scale, 8pt spacing grid, touch targets, and the canonical output format of design-system.md (the file the harness gates on). This is routing step 1 of design-method/SKILL.md — read it before design-web/design-webapp/design-ios/design-android, before picking or auditing a single color/type/spacing value.