Tailwind-v4

Tailwind-v4 is a cursor rule for coding agents from RayFernando1337/llm-cursor-rules. It costs 0 tokens per session (768 once invoked), scanned A, original, MIT.

A set of rules for using Tailwind CSS version 4, a CSS toolkit that styles pages with reusable utility classes. It covers class organization, responsive states, themes, custom utilities, and modern color formats.

In plain words
What is it for?
Use it when adding or changing Tailwind-based layouts, responsive behavior, dark mode, design tokens, container queries, or custom CSS utilities.
Why use it?
It keeps styling consistent across a project and guides agents toward the current Tailwind v4 configuration and CSS patterns.

Cursor rule

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.

agentmods
npx agentmods add rules/rayfernando1337/llm-cursor-rules/tailwind-v4
Clone the repo
git clone --depth 1 https://github.com/RayFernando1337/llm-cursor-rules

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 Tailwind-v4

README.md
[![agentmods](https://agentmods.dev/badge/rules/rayfernando1337/llm-cursor-rules/tailwind-v4.svg)](https://agentmods.dev/rules/rayfernando1337/llm-cursor-rules/tailwind-v4)
Your own site
<a href="https://agentmods.dev/rules/rayfernando1337/llm-cursor-rules/tailwind-v4"><img src="https://agentmods.dev/badge/rules/rayfernando1337/llm-cursor-rules/tailwind-v4.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 768 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00000 $0.00768
Opus 5 $0.00000 $0.00384
Sonnet 5 $0.00000 $0.00154
Haiku 4.5 $0.00000 $0.00077

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

Security

Grade A, and why

Tailwind-v4 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.

Tailwind-v4.mdc · 51 lines

How it starts

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

General Guidelines

  • Use Tailwind utility classes for consistent styling, with custom CSS only for special cases
  • Organize classes logically (layout, spacing, color, typography)
  • Use responsive and state variants (e.g., sm:, md:, lg:, hover:, focus:, dark:) in markup
  • Embrace Tailwind v4 features like container queries and CSS variables
  • Keep tailwind.config.ts updated with design tokens and purge paths
  • Rely on Tailwind classes rather than inline styles or external CSS files for a unified design language

Configuration (CSS Files)

  • Use the @theme directive to define custom design tokens like fonts, breakpoints, and colors
  • Prefer modern color formats such as oklch for better color gamut support, defining them in the :root scope
  • Take advantage of automatic content detection, which eliminates the need for a content array in configuration
  • Rely on Oxide engine to scan project files, excluding those in .gitignore and binary extensions
  • Add specific sources with @source only when necessary
  • Extend Tailwind with custom utilities using the @utility directive in CSS files

Styling (CSS Files)

  • Incorporate 3D transform utilities like rotate-x-*, rotate-y-*, and scale-z-* for advanced visual effects
  • Implement container queries with @container, @max-*, and @min-* utilities for adaptive layouts
  • Use arbitrary values and properties with square bracket notation (e.g., [mask-type:luminance] or top-[117px])
  • Apply modifiers like hover or lg with arbitrary values for flexible styling
  • Use the not-* variant for :not() pseudo-classes and the starting variant for @starting-style
  • Check browser support for advanced features like @starting-style using resources like caniuse

Components (HTML)

  • Apply Tailwind utility classes directly in HTML for styling components
  • Use dynamic arbitrary values like grid-cols-[1fr_500px_2fr] for flexible layouts
  • Implement data attribute variants like data-current:opacity-100 for conditional styling
  • Ensure accessibility by pairing Tailwind utilities with appropriate ARIA attributes
  • Use aria-hidden="true" or role="presentation" when applying utilities like hidden or sr-only

Read the full file on GitHub · 51 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 · 51 lines · 768 tokens per session scan A b56221763104

Subscribe to this mod's changes

Tailwind-v4 is a cursor rule published in the GitHub repository RayFernando1337/llm-cursor-rules (888 stars, last pushed 9mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 768 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-08-30.