Styling patterns and conventions for frontend applications. Contains 10 rules covering layout utilities, affordances, color schemes, responsive design, and className handling.
Works with
AI-first code editor with Composer
Before installing skills in Cursor, ensure your development environment meets these requirements:
node --versionfrontend-tailwind-best-practicesExecute the skills CLI command in your project's root directory to begin installation:
Fetches frontend-tailwind-best-practices from sergiodxa/agent-skills and configures it for Cursor.
The CLI shows a list of agents. Use arrow keys and space to select Cursor:
Confirm successful installation by checking the skill directory location:
Restart Cursor to activate frontend-tailwind-best-practices. Access via /frontend-tailwind-best-practices in your agent's command palette.
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your environment. Always review source, verify the publisher, and test in isolation before production.
Submit your Claude Code skill and start earning
Automate repetitive workflows and reduce manual effort
Example
Generate reports, summarize documents, draft communications
Save 3-5 hours per week on routine tasks
Learn new skills, understand complex topics, get expert guidance
Example
Explain concepts, provide examples, suggest learning resources
Accelerate learning and skill development by 2x
Enhance output quality through reviews, suggestions, and refinements
Example
Review drafts, suggest improvements, catch errors
Improve work quality by 30-40% with less effort
0
total installs
0
this week
81
GitHub stars
0
upvotes
Run in your terminal
0
installs
0
this week
81
stars
Styling patterns and conventions for frontend applications. Contains 10 rules covering layout utilities, affordances, color schemes, responsive design, and className handling.
Reference these guidelines when:
Use custom stack utilities instead of flex classes.
// Bad
<div className="flex flex-col gap-4">
<div className="flex flex-row gap-4">
// Good
<div className="v-stack gap-4">
<div className="h-stack gap-4">
Available utilities:
v-stack - Vertical stack (flex column)h-stack - Horizontal stack (flex row)v-stack-reverse - Reversed vertical stackh-stack-reverse - Reversed horizontal stackz-stack - Overlapping stack (grid-based, centers children on top of each other)center - Center content both horizontally and verticallyspacer - Flexible spacer that fills available spacecircle - Perfect circle with aspect-ratio 1/1Use gap-* on parents instead of child margins.
// Bad
<div>
<Item className="mb-4" />
<Item className="mb-4" />
</div>
// Good
<div className="flex flex-col gap-4">
<Item />
<Item />
</div>
Switch layout direction at breakpoints.
// Mobile: vertical, Desktop: horizontal
<div className="v-stack lg:h-stack gap-4">
<main className="grow">...</main>
<aside className="shrink-0 lg:w-80">...</aside>
</div>
// Mobile: horizontal, Desktop: vertical
<div className="h-stack md:v-stack">
Use class-based color schemes with a custom dark variant.
<button className="rounded-full bg-gray-900 px-4 py-2 text-white dark:bg-gray-100 dark:text-gray-900">
Toggle
</button>
Always use cn() to merge classNames in components.
import { cn } from "~/lib/cn";
function Button({ className, variant }: Props) {
return (
<button
className={cn(
"base-classes",
{
"variant-primary": variant === "primary",
"variant-secondary": variant === "secondary",
},
className, // external className always last
)}
/>
);
}
Use proper types for className props.
import type { ClassName, ClassNameRecord } from "~/lib/cn";
// Single element
type Props = {
className?: ClassName;
};
// Multiple elements
type Props = {
className?: ClassNameRecord<"root" | "label" | "input">;
};
// Usage
<Input className={{ root: "w-full", label: "font-bold" }} />;
Define element-agnostic visual patterns that compose with utilities.
<label className="ui-button" htmlFor="document-upload">
Choose file
</label>
Use responsive prefixes with Tailwind defaults.
// Standard breakpoints (min-width)
<div className="px-4 md:px-8 lg:px-12">
// Show/hide with standard breakpoints
<div className="hidden md:block">Desktop only</div>
<div className="md:hidden">Mobile only</div>
Scale text responsively.
// Responsive font size
<h1 className="text-2xl md:text-3xl lg:text-4xl">
// Responsive line height with text
<p className="text-sm leading-5 md:text-base md:leading-6">
Design for input capabilities (pointer/hover) instead of device labels.
<button className="h-10 w-10 pointer-coarse:h-12 pointer-coarse:w-12">
<Icon />
</button>
| Don't | Do |
|---|---|
flex flex-col |
v-stack |
flex flex-rowImplementation GuidePrerequisites
Time Estimate 15-45 minutes depending on use case complexity Steps
Common Pitfalls
Best Practices✓ Do
✗ Don't
💡 Pro Tips
When to Use This✓ Use when Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement. ✗ Avoid when Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion. Learning Path
Related Skillsreact-vite-best-practices59asyrafhussin/agent-skills Frontend2 shared tags typescript-best-practices166jwynia/agent-skills Backend2 shared tags nestjs-best-practices77kadajett/agent-nestjs-skills Productivity2 shared tags frontend-design667anthropics/claude-code Frontendtag: frontend premium-frontend-ui238github/awesome-copilot Frontendtag: frontend frontend-ui-ux100code-yeongyu/oh-my-opencode Frontendtag: frontend Reviews4.7★★★★★42 reviews
showing 1-10 of 42 1 / 5 DiscussionComments — not star reviews
|