Vite tailwind radix

From makifbaysal/tasktrooper · View interactive version

Vite tailwind radix is an AI agent skill from the GitHub repository makifbaysal/tasktrooper. Use when styling any web UI - style with Tailwind utility classes and design tokens, avoid custom CSS, and build on the existing Radix/shadcn primitives instead of hand-rolling

How to use this skill

Skill file

Tailwind, Radix, No Custom CSS

Overview

Styling is Tailwind-first with a shared token system, on top of Radix/shadcn primitives. Custom CSS and hand-rolled interactive widgets are what this skill exists to prevent — they fragment the design and re-introduce accessibility bugs the primitives already solved.

Core principle: Avoid custom CSS. Style with Tailwind utilities and the design tokens; reach for the existing shadcn primitive before building an interactive widget, and its built-in variant before a custom class.

Rules

Where things live

When an inline style / arbitrary value IS ok

| Situation | Verdict |

|-----------|---------|

| Static padding/color/size | Tailwind token class |

| Conditional variant | cn() with utility classes |

| Value computed at runtime (measured px, dynamic transform) | inline style={{}} — the only valid case, tag ui-guard-allow: if ui-guard runs |

| A one-off pixel that "isn't in the scale" | No — use the nearest scale token; extend the scale via tokens if truly needed |

| grid-cols-[repeat(auto-fit,minmax(...))], max-w-[..ch], aspect-[..] | Allowed arbitrary values (ui-guard's allow-list) |

Worked Example

// ❌ custom CSS + magic values + hand-rolled dropdown
<div className="my-custom-menu" style={{ padding: "13px", background: "#f5f5f5" }}>
  {/* hand-built menu: no keyboard nav, no ARIA */}
</div>

// ✅ tokens + primitive + built-in variant
<DropdownMenu>                          {/* Radix primitive from components/ui */}
  <DropdownMenuTrigger asChild><Button variant="ghost">Actions</Button></DropdownMenuTrigger>
  <DropdownMenuContent className="p-3">
    <DropdownMenuGroup>
      <DropdownMenuItem onSelect={onExport}>Export</DropdownMenuItem>
    </DropdownMenuGroup>
  </DropdownMenuContent>
</DropdownMenu>

The primitive brings focus management, escape-to-close, and ARIA for free; the token classes and DropdownMenuGroup keep it visually and structurally identical to every other menu.

Common Mistakes

Red Flags

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.