mengto/skills

tailwindcss

Use when designing/implementing UI with Tailwind CSS (layout, typography, responsive, theming, component patterns).

View source
Original skill document

Rendered from the source repository. Headings, examples, code, tables, links, and referenced images are preserved.

Tailwind CSS — Utility-first Styling Skill

When to use

  • Rapid UI building with consistent spacing/typography scales
  • Design systems where composition beats bespoke CSS
  • Component-driven apps (React/Vue/Svelte), marketing pages, prototypes → production

Key concepts & patterns

  • Utilities compose in HTML/JSX: class="flex gap-4 p-6 bg-zinc-950 text-white"
  • Responsive variants: sm: md: lg: xl: etc.
  • State variants: hover:, focus:, active:, disabled:, group-hover:, peer-checked:
  • Arbitrary values (use sparingly): w-[42rem], bg-[#0b1220], translate-y-[3px]
  • Dark mode patterns: dark: with class-based strategy
  • Extracting repeated patterns:
  • Prefer components (JSX/Vue components) first
  • Then @apply for small reusable patterns (avoid overuse)
  • Build pipeline:
  • Tailwind scans “content” files for class names and generates CSS (zero-runtime)

Common pitfalls

  • Classes not generated in production
  • Ensure content paths include all templates/components.
  • Avoid building class names dynamically (e.g. "text-" + color) unless safelisted.
  • Overusing @apply and losing the utility-first benefits
  • Conflicting styles due to class order assumptions
  • Huge HTML class lists with no structure
  • Use component composition; break into subcomponents; use clsx/cva when needed.

Quick recipes

1) A clean CTA button

html
<button class="inline-flex items-center justify-center rounded-xl px-5 py-3
               bg-indigo-600 text-white font-medium
               hover:bg-indigo-500 active:bg-indigo-700
               focus:outline-none focus:ring-2 focus:ring-indigo-400/60">
  Get started
</button>

2) Responsive hero layout

html
<section class="mx-auto max-w-6xl px-6 py-16">
  <div class="grid gap-10 lg:grid-cols-2 lg:items-center">
    <div>
      <h1 class="text-4xl font-semibold tracking-tight sm:text-5xl">
        Ship a beautiful site fast.
      </h1>
      <p class="mt-4 text-zinc-600">
        Tailwind helps you move quickly without fighting CSS.
      </p>
    </div>
    <div class="rounded-2xl border border-zinc-200 bg-white p-6 shadow-sm">
      <!-- media -->
    </div>
  </div>
</section>

3) Handling dynamic classnames safely

Prefer mapping:

js
const toneClass = {
  success: "bg-emerald-600",
  danger: "bg-rose-600",
  info: "bg-sky-600",
}[tone];

What to ask the user

  • Framework/build tool (Next/Vite/Remix/Webflow export)?
  • Do we need a design system (tokens, component library) or a one-off page?
  • Dark mode? RTL? accessibility constraints?
from this repository

More skills

All skills
mengto
Community

build-awwwards-quality-sites

Art-direct and implement distinctive, motion-rich marketing, editorial, portfolio, and landing websites with original reference-inspired imagery, standout heroes, GSAP choreography, one smooth-scroll engine, optional Three.js shaders, honest icon and logo sourcing, photo avatars, accessibility, and performance safeguards. Use when a user asks for an Awwwards-quality, premium, cinematic, interactive, high-concept, or motion-led website, or explicitly requests this visual and motion system.

installs
3
GitHub stars
6.8K
Updated
Oct 6
mengto
Community

landing-page

Use when designing or rewriting a high-converting landing page (single-offer page) for SaaS/apps/services. Covers structure, layout patterns, conversion strategies, copywriting, SEO/AEO, and common pitfalls.

installs
2
GitHub stars
6.8K
Updated
Oct 6
mengto
Community

3d-cloth-material

Build convincing woven cloth in Three.js, with a thread-level weave normal map, sheen and anisotropic highlights, folds that never stretch the texture, hems with thickness, stitches, seams, frayed edges, fold occlusion, dye and wear variation, and light passing through thin fabric. Use for linen, silk, wool, canvas, curtains, banners, cloaks, tablecloths, tapestries or any 3D drape that currently looks like a plastic sheet, a stretched texture, or a flat coloured plane.

installs
2
GitHub stars
6.7K
Updated
Oct 6
mengto
Community

3d-falling-leaves

Build recognizable falling leaves in world space using instanced geometry, independent tumble, coupled sideways drift, shared wind, scene occlusion, and camera-aware recycling. Use for 3D autumn leaves or drifting foliage in Three.js and similar scenes; use falling-leaves for a 2D canvas overlay.

installs
2
GitHub stars
6.7K
Updated
Oct 6