tailwind-patterns

A set of Tailwind CSS styling rules for Vue 3, a framework for building web interfaces. It covers responsive layouts, dark mode, dynamic styles, reusable classes, and accessible component combinations.

In plain words
What is it for?
Use it when building or reviewing Vue 3 components styled with Tailwind CSS, especially buttons and other components with different sizes, states, or visual variants.
Why use it?
It gives Vue components a consistent way to handle variants, screen sizes, and themes without scattering custom CSS throughout the interface.

Cursor rule for Cursor

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/aliarghyani/vue-cursor-rules/tailwind-patterns
Clone the repo
git clone --depth 1 https://github.com/aliarghyani/vue-cursor-rules

Made for: Cursor.

Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 894 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.00894
Opus 5 $0.00000 $0.00447
Sonnet 5 $0.00000 $0.00179
Haiku 4.5 $0.00000 $0.00089

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

Security

Grade A, and why

tailwind-patterns 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/tailwind-patterns.mdc · 106 lines

How it starts

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

Tailwind CSS Integration

Role: You are a Vue 3 expert specializing in utility-first CSS with Tailwind.

Core Rules:

  • Use computed classes for dynamic styling
  • Follow mobile-first responsive design
  • Implement dark mode with class variants
  • Prefer utility classes over custom CSS
  • Extract complex patterns to component classes

Chain-of-Thought: Think step-by-step: 1. Plan component variants 2. Create computed class objects 3. Apply responsive patterns 4. Add dark mode support

Note: Tailwind works alongside any UI kit -- use for custom styling or as the primary framework. Compatible with Headless UI for accessible components.

Component Styling Patterns

  • Drive variants with computed class arrays/objects so markup stays lean.
  • Full example: examples/tailwind-button.vue covers variant, size, and disabled props.
const sizeClasses = { sm: 'px-3 py-1.5 text-sm', md: 'px-4 py-2 text-base', lg: 'px-6 py-3 text-lg' }
const variantClasses = {
  primary: 'bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500',
  secondary: 'bg-gray-200 text-gray-900 hover:bg-gray-300 focus:ring-gray-500',
  danger: 'bg-red-600 text-white hover:bg-red-700 focus:ring-red-500',
}
const props = withDefaults(
  defineProps<{ variant?: keyof typeof variantClasses; size?: keyof typeof sizeClasses }>(),
  { variant: 'primary', size: 'md' }
)
const buttonClasses = computed(() => [
  'inline-flex items-center justify-center font-medium transition-colors',
  sizeClasses[props.size ?? 'md'],
  variantClasses[props.variant ?? 'primary'],
])

Responsive Design Patterns

  • Start mobile-first, then layer sm/ md/ lg utilities for additional breakpoints.
  • Extract repeatable grid/typography patterns into slots or components.
  • Full layout example: examples/tailwind-responsive.vue.
<div class="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">
  <article v-for="item in items" :key="item.id" class="rounded-lg shadow p-4">...</article>
</div>

Read the full file on GitHub · 106 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 · 106 lines · 0 tokens per session scan A 9a187c19226a

Subscribe to this mod's changes

tailwind-patterns is a cursor rule published in the GitHub repository aliarghyani/vue-cursor-rules (11 stars, last pushed 11mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 894 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.