3 tailwind rules available
Three Windsurf rules match tailwind: a Tailwind CSS rule, a Tailwind components rule and the React guidelines rule tagged tailwind. Windsurf's rules documentation now redirects to Devin docs, which use .devin/rules/; legacy .windsurfrules files are still imported. The file triggers on stylesheets and markup.
Windsurf's rules documentation (docs.windsurf.com/windsurf/cascade/memories) now redirects to Devin documentation, which describes rules for the Devin Local agent in Devin Desktop. Current rules live in .devin/rules/*.md with a trigger setting, and the legacy Windsurf files (.windsurf/rules/*.md, .windsurf/global_rules.md and .windsurfrules) are still imported by default. AGENTS.md files are read as always-on rules.
.devin/rules/tailwind.mdStarting point, not a tested configuration for your repository. Applied when files matching globs are involved (trigger: glob). Review the instructions, adapt the file paths and run your project's existing checks.
---
trigger: glob
globs: "**/*.css,**/*.html,**/*.tsx,**/*.jsx,**/*.vue,**/*.svelte"
---
# Tailwind CSS instructions for Windsurf
## Focus for this project
- Map component variants to complete class strings in an object (or the project's variant helper, for example cva).
- Merge caller classes with the project's helper (for example tailwind-merge) if it exists.
- Keep focus-visible styles on every interactive variant.
## Tailwind CSS conventions
- Identify the Tailwind version first. v4 projects import Tailwind with @import "tailwindcss"; and define design tokens with @theme in CSS; v3 projects use tailwind.config.js. Edit the one the project actually uses.
- Write complete class names in source. Tailwind detects classes as plain text, so interpolated names such as bg-${color}-500 are not generated; map values to full class strings instead.
- Use theme tokens instead of arbitrary values like text-[#3b82f6] unless the value is genuinely one-off.
- Style mobile first and add sm:/md:/lg: variants for larger screens; keep focus-visible styles on interactive elements.
## Before you finish
- Run the CSS build or dev server, a visual check of the changed component at a mobile and a desktop width, and the lint script and report the actual output. If you cannot run them, say so and list the exact commands instead of saying they pass.
- Summarize which of the rules above affected the change.
- If a legacy .windsurfrules or .windsurf/rules file gives conflicting guidance, point out the conflict instead of silently choosing one.
Create your own Windsurf rules for Tailwind CSS and share with the community.
Ask for a small change to one matching file. Check the tool's loaded context or instruction view, inspect the diff for the requested convention, and run the relevant build or test. A well-formatted file does not guarantee the model follows every instruction.
The docs recommend keeping rules short and specific. The current docs say AGENTS.md, AGENTS.local.md and AGENT.md are read as always-on rules, including files in subdirectories. Use .devin/rules/ when you need glob, model-decision or manual triggers.
Documentation checked 2026-11-05: Devin docs: Local customizations (redirect target of Windsurf memories docs)Windsurf docs: Cascade memories (redirects)
Illustrative input and expected result. This example is a verification guide, not a recorded model run.
You use the Windsurf agent to build Tailwind components and want variants handled without string interpolation.
Create a Button with primary, secondary and danger variants and sm/md sizes.
A Button using a variant map of full class names, focus-visible styles, no bg-${variant} interpolation, and a visual check of each variant.Content reviewed 2026-11-05. Confirm instruction activation in your installed client before relying on it.
Windsurf rules for Tailwind CSS v4: tool-sorted classes, mobile-first grids, class-based dark mode via @custom-variant, and typed variant maps with complete class names.