Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Tailwindcss Core

ASecurity

Use when configuring Tailwind CSS-first (no config.js), defining @theme tokens, or creating custom utilities/variants. Do NOT use for v3-to-v4 migration or category utility lookup.

29 stars
0 votes
0 copies
0 views
Added 2/7/2026
developmentjavascriptgojavanode

Security Analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned 9/29/2026

$npx -y skills add fusengine/agents --skill tailwindcss-core --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Tailwindcss Core?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Tailwindcss Core
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/fusengine-tailwindcss-core/badge)](https://www.skillsdirectory.com/skills/fusengine-tailwindcss-core)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
name: tailwindcss-core
description: "Use when configuring Tailwind CSS-first (no config.js), defining @theme tokens, or creating custom utilities/variants. Do NOT use for v3-to-v4 migration or category utility lookup."
user-invocable: false
---

<objective>
Documents Tailwind CSS v4.3's CSS-first configuration directives: `@import "tailwindcss"`, `@theme` for defining theme tokens as CSS custom properties, `@source` for scanning additional source files, `@utility`/`@variant` for custom utilities and variants, `@apply` for composing utilities in custom CSS, and `@config` for loading a legacy JS config.

Also covers dark-mode variant setup, responsive breakpoints via `@theme`, CSS layer hierarchy (`theme, base, components, utilities`), and plugin integration — the full CSS-first replacement for `tailwind.config.js`.
</objective>

# Tailwind CSS Core v4.3

## Overview

Tailwind CSS v4 (since v4.0; current stable v4.3) uses 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.

## Key Concepts

### 1. @import "tailwindcss"

Entry point to load Tailwind CSS. Place at the beginning of your main CSS file.

```css
@import "tailwindcss";
```

This directive automatically loads:
- Base utilities
- Responsive variants
- Layers (theme, base, components, utilities)

### 2. @theme

Directive to define or customize theme values via CSS custom properties.

```css
@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.

### 3. @source

Directive to include additional source files with glob patterns.

```css
@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.

### 4. @utility and @variant

Directives to create custom utilities and variants.

```css
@utility truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Define a new variant with @custom-variant */
@custom-variant theme-midnight (&:where([data-theme="midnight"] *));

/* Apply an existing variant inside CSS with @variant
   (stacked `hover:focus` and compound `hover, focus` forms since v4.3) */
.card {
  @variant hover:focus {
    background: var(--color-sky-600);
  }
}
```

### 5. @apply

Directive to apply Tailwind classes in your custom CSS rules.

```css
.btn {
  @apply px-4 py-2 rounded-lg font-semibold;
}

.btn-primary {
  @apply bg-blue-500 text-white hover:bg-blue-600;
}
```

### 6. @config

Directive to load external configuration if needed.

```css
@config "./tailwind.config.js";
```

(Optional in v4, mainly used for backward compatibility)

## Dark Mode

Dark mode configuration in Tailwind v4.3:

```css
@import "tailwindcss";

/* Default: `dark:` follows prefers-color-scheme — no config needed */
```

Or via manual class (override the `dark` variant with `@custom-variant`):

```css
@custom-variant dark (&:where(.dark, .dark *));
```

## Responsive Breakpoints

Breakpoints are defined via `@theme`:

```css
@theme {
  --breakpoint-sm: 640px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 1024px;
  --breakpoint-xl: 1280px;
  --breakpoint-2xl: 1536px;
}
```

Responsive variants are used with utilities:

```html
<div class="text-sm md:text-base lg:text-lg"></div>
```

## Layer Hierarchy

```css
@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); }
}
```

## Plugin Integration

Load Tailwind plugins:

```css
@import "tailwindcss";
@plugin "flowbite/plugin";
@source "../node_modules/flowbite";
```

## Specificity Order

In CSS-first, import and declaration order determines specificity:

1. `@import "tailwindcss"` - Base utilities
2. `@theme { ... }` - Theme variables
3. `@layer components { ... }` - Custom components
4. `@layer utilities { ... }` - Custom utilities

## CSS-first Mode Benefits

- No complex JavaScript config file
- Type-safe via CSS variables
- Declarative and readable configuration
- Replaces CSS preprocessors (Tailwind v4 is not designed to be used with Sass/Less/Stylus)
- Simplified maintenance for large projects

## Detailed References

See specific files for:
- `theme.md` - Complete theme variable configuration
- `directives.md` - Syntax and examples of all directives
- `config.md` - Advanced configuration and use cases

Attribution

fusenginefusengine
View sourceSee grades on GitHubMore from fusengine →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Clean Code

Pragmatic coding standards - concise, direct, no over-engineering, no unnecessary comments

304955 votes

Browser Extension Developer

Use this skill when developing or maintaining browser extension code in the `browser/` directory, including Chrome/Firefox/Edge compatibility, content scripts, background scripts, or i18n updates.

285172 votes

Seo Optimizer

SEO optimization with keyword analysis, readability assessment, technical validation, content quality. Use for search rankings, blog posts, content audits, or encountering keyword density, readability scores, meta tags, schema markup errors.

2222 votes

Google Official Seo Guide

Official Google SEO guide covering search optimization, best practices, Search Console, crawling, indexing, and improving website search visibility based on official Google documentation

1862 votes

Tanstack Start

Build a full-stack TanStack Start app on Cloudflare Workers from scratch — SSR, file-based routing, server functions, D1+Drizzle, better-auth, Tailwind v4+shadcn/ui. Use whenever the user mentions TanStack Start, asks to scaffold a full-stack Cloudflare app with SSR, wants an SSR dashboard, or asks for a React 19 + Cloudflare Workers app with file-based routing and server functions — even if they don't name TanStack Start specifically. No template repo — Claude generates every file fresh per ...

10341 votes
View all in development →