tailwind

A set of guidelines for Tailwind CSS, a styling tool that builds interfaces from small reusable CSS classes.

In plain words
What is it for?
Use it when styling React or other web components, arranging utility classes, building responsive designs, and extracting repeated styles into components.
Why use it?
It keeps long lists of styling classes organized and makes responsive, mobile-first layouts more consistent.

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/renvia-code/best-cursor-rules/tailwind
Clone the repo
git clone --depth 1 https://github.com/Renvia-code/best-cursor-rules
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 1,852 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.01852
Opus 5 $0.00000 $0.00926
Sonnet 5 $0.00000 $0.00370
Haiku 4.5 $0.00000 $0.00185

Measured yesterday against content hash 4491948b77cc, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

tailwind 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 yesterday.

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.

rules/styling/tailwind.mdc · 325 lines

How it starts

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

Tailwind CSS Best Practices

Overview

Aspect Recommendation
Version Tailwind CSS v4 (2025)
Config tailwind.config.ts
Approach Utility-first, extract components when repeated

Class Organization

Recommended Order

// Order: Layout → Spacing → Sizing → Typography → Colors → Effects → States
<div className="
  flex items-center justify-between     // Layout
  p-4 gap-4                             // Spacing
  w-full max-w-md                       // Sizing
  text-sm font-medium                   // Typography
  text-gray-900 bg-white                // Colors
  rounded-lg shadow-md                  // Effects
  hover:bg-gray-50 focus:ring-2         // States
"/>

Group Related Utilities

// ✅ Good - grouped logically
<button className="
  px-4 py-2 
  text-sm font-semibold text-white 
  bg-blue-600 rounded-lg 
  hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500
">
  Click me
</button>

// ❌ Bad - random order
<button className="bg-blue-600 text-sm px-4 rounded-lg py-2 font-semibold hover:bg-blue-700 text-white focus:ring-2">
  Click me
</button>

Responsive Design

Mobile-First Approach

// Start with mobile, add breakpoints for larger screens
<div className="
  grid grid-cols-1        // Mobile: 1 column
  md:grid-cols-2          // Tablet: 2 columns
  lg:grid-cols-3          // Desktop: 3 columns
  xl:grid-cols-4          // Large desktop: 4 columns
  gap-4
">
  {items.map(item => <Card key={item.id} />)}
</div>

Breakpoint Reference

Breakpoint Min-width Use case
sm: 640px Large phones
md: 768px Tablets
lg: 1024px Laptops
xl: 1280px Desktops
2xl: 1536px Large screens

Component Patterns

Button Variants

// Base button styles
const buttonBase = "inline-flex items-center justify-center rounded-lg font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none"

// Variants
const variants = {
  primary: "bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500",
  secondary: "bg-gray-100 text-gray-900 hover:bg-gray-200 focus:ring-gray-500",
  destructive: "bg-red-600 text-white hover:bg-red-700 focus:ring-red-500",
  ghost: "hover:bg-gray-100 text-gray-700",
}

// Sizes
const sizes = {
  sm: "h-8 px-3 text-sm",
  md: "h-10 px-4 text-sm",
  lg: "h-12 px-6 text-base",
}

Read the full file on GitHub · 325 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. yesterday First seen · 325 lines · 0 tokens per session scan A 4491948b77cc

Subscribe to this mod's changes

tailwind is a cursor rule published in the GitHub repository Renvia-code/best-cursor-rules (12 stars, last pushed 9mo ago), licensed CC0-1.0. It costs nothing until one of its globs matches a file; then it loads 1,852 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.