Tailwind4

Tailwind4 is a cursor rule for Cursor from TheSethRose/DevRules. It costs 0 tokens per session (1,057 once invoked), scanned A, original, MIT.

A set of Tailwind CSS 4 or newer guidelines for styling web applications. Tailwind CSS is a toolkit that applies small reusable style classes to page elements.

In plain words
What is it for?
Use it when setting up Tailwind 4, defining theme values, configuring CSS, and integrating it with web frameworks.
Why use it?
It helps keep styling configuration and CSS structure consistent with current Tailwind practices.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it when setting up Tailwind 4, defining theme values, configuring CSS…

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/thesethrose/devrules/tailwind4
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/TheSethRose/DevRules

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for Tailwind4

README.md
[![agentmods](https://agentmods.dev/badge/rules/thesethrose/devrules/tailwind4.svg)](https://agentmods.dev/rules/thesethrose/devrules/tailwind4)
Your own site
<a href="https://agentmods.dev/rules/thesethrose/devrules/tailwind4"><img src="https://agentmods.dev/badge/rules/thesethrose/devrules/tailwind4.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 1,057 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.01057
Opus 5 $0.00000 $0.00528
Sonnet 5 $0.00000 $0.00211
Haiku 4.5 $0.00000 $0.00106

Measured 3d ago against content hash eefe941f4a61, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

Tailwind4 scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/technologies/Tailwind4.mdc · 86 lines

How it starts

The opening of the file, as written. The whole thing — 86 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Tailwind CSS v4+ Best Practices

Core Concepts & Setup (v4 Focus)

  • Leverage Native CSS: Understand that Tailwind v4 integrates more deeply with native CSS features.
  • Primary CSS Entry Point: Use a single CSS file (e.g., src/app.css) as the main entry point.
  • Import Tailwind: Import Tailwind's core styles using native CSS @import statements within your main CSS file:
    /* src/app.css */
    @import "tailwindcss";
    
  • CSS Variables for Configuration: Configure and customize Tailwind primarily using standard CSS variables directly in your CSS file. The tailwind.config.js file is often unnecessary for basic theme customizations.
    /* src/app.css */
    @import "tailwindcss";
    
    @layer theme {
      :root {
        --color-primary: oklch(60% 0.2 260);
        --font-sans: "Inter", sans-serif;
      }
    }
    
  • Minimal tailwind.config.js: Only use tailwind.config.js (or .ts) for advanced configurations not expressible via CSS variables (like plugins or complex variants) or if preferred for organization.
  • No content Configuration Needed (Typically): Tailwind v4's engine often doesn't require the content array in the config file due to its build process integration.
  • Framework Integration: Follow framework-specific guides (Next.js, Vite, etc.) for optimal setup, ensuring Tailwind processes your main CSS entry point.

Styling Philosophy

  • Utility-First: Apply styles primarily using Tailwind's utility classes directly in your markup (HTML/JSX/Vue/Svelte templates).
  • Avoid Premature Abstraction: Only create reusable component classes or use @layer components when a pattern is truly reused significantly and warrants abstraction.
  • Consistency: Use the defined theme values (colors, spacing, fonts) via utilities rather than arbitrary magic numbers.

Using Utilities

  • Apply utilities directly in the class attribute.
  • Combine utilities for desired styling (e.g., flex items-center justify-between p-4 bg-primary text-white).
  • Understand variant modifiers for states (e.g., hover:, focus:, dark:, group-hover:) and breakpoints (e.g., sm:, md:, lg:).

Read the full file on GitHub · 86 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 86 lines · 1,057 tokens per session scan A eefe941f4a61

Subscribe to this mod's changes

Tailwind4 is a cursor rule published in the GitHub repository TheSethRose/DevRules (25 stars, last pushed 1y ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,057 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.