All skills
sergiodxa avatar

/frontend-tailwind-best-practices

@fa6e3fc

Tailwind CSS patterns and conventions for frontend apps. Use when writing component styles, layouts, or working with CSS classes.

Use this Skill: https://skilld.dev/gh/sergiodxa/agent-skills/frontend-tailwind-best-practices

This session only. Nothing lands on disk.

rulesresponsive-capabilities.md

≈307 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Design for Capabilities, Not Device Labels

Target input capabilities (pointer, hover) and viewport ranges instead of assuming “mobile” or “desktop.”

Why

  • Many devices support both touch and mouse
  • Screen size doesn’t equal input capability
  • Capability-based styles age better than device lists

Pattern

Use pointer/hover variants to adjust targets and affordances:

// Larger targets on coarse pointers (touch)
<button className="h-10 w-10 pointer-coarse:h-12 pointer-coarse:w-12">
  <Icon />
</button>

// Hover effects only when hover is supported
<button className="bg-gray-900 text-white hover:bg-gray-800">
  Primary
</button>

Use breakpoints for layout clusters, not specific devices:

<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
  {items.map((item) => (
    <Card key={item.id} />
  ))}
</div>

Rules

  1. Avoid “mobile vs desktop” assumptions in UI behavior
  2. Use pointer-coarse/pointer-fine for target sizes
  3. Keep hover-only affordances behind hover-capable variants
  4. Place breakpoints in layout clusters, not exact device widths

Source: SKILL.md on GitHub

No alerts16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    The skill is a collection of architectural guidelines and best practices for Tailwind CSS. It provides documentation on layout utilities, color schemes, and component styling patterns without any executable code or suspicious behaviors.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer7mo

    11 files scanned · No issues

  • ZeroLeaks5mo

    1 finding · Score: 86/100

Signed by skilld at fa6e3fc. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Dormantupdated 8 months ago

README badge

README badge for sergiodxa/agent-skills/frontend-tailwind-best-practices