Tailwindcss Mobile First

作者 josiahsiegel5a1b1123b9e5無授權條款58 個星標收錄於 2026年10月8日更新於 2026年10月8日儲存庫3 個月前更新

Mobile-first responsive design patterns with Tailwind CSS v4 (2025-2026). PROACTIVELY activate for: (1) mobile-first design with Tailwind breakpoints (sm:, md:, lg:, xl:, 2xl:), (2) responsive utility ordering (default = mobile, then breakpoints), (3) responsive typography (text-base sm:text-lg lg:text-xl), (4) responsive grids and flexbox, (5) hide/show across breakpoints (hidden md:block), (6) max-* breakpoints for desktop-down overrides, (7) container queries (@container) for component-level responsiveness, (8) safe-area insets and notch handling, (9) landscape vs portrait orientation, (10) touch vs hover (hover: with @media). Provides: breakpoint reference, mobile-first patterns, container-query examples, safe-area recipes, and touch/hover handling.

AI 產生的概覽

指導使用 Tailwind CSS v4 進行行動優先響應式設計,涵蓋斷點、容器查詢、安全區域與觸控目標。

功能
此技能為使用 Tailwind CSS v4 建構行動優先的響應式介面提供指引。內容涵蓋斷點策略、流體排版與間距、響應式網格與彈性版面、容器查詢、安全區域內距、橫向與直向處理,以及觸控與滑鼠懸停行為的區分。它會針對特定任務提供實作建議與可直接複製的程式碼片段,並指向隨附的參考指南以取得更詳細的說明。
適用情境
適用於在 Tailwind CSS 中實作或除錯響應式版面時,尤其是在決定斷點策略、排列響應式工具類別,或處理行動版導覽、瀏海螢幕裝置與觸控互動時。也適合正式環境強化與對效能敏感的響應式決策。
執行需求
不含指令碼,僅為說明文件加一份參考 Markdown 檔案。假定專案使用 Tailwind CSS v4,且代理需要能存取該技能資料夾以讀取參考指南。

Tailwind Mobile-First Skill

Use this skill for Tailwind CSS mobile-first responsive design: breakpoint strategy, fluid typography and spacing, touch targets, container queries, safe areas, responsive layouts, media, navigation, and mobile performance.

When to Use This Skill

Use when the user asks for tasks covered by the frontmatter triggers, especially implementation guidance, debugging, architecture choices, production hardening, or performance-sensitive decisions in this domain. Start from this orchestrator, then load the focused reference file that matches the requested detail level.

Core Workflow

  1. Start with unprefixed utilities for the mobile baseline, then progressively enhance with sm:, md:, lg:, xl:, and 2xl:.
  2. Choose breakpoints from content needs rather than device names; override Tailwind v4 theme breakpoints only when the design system requires it.
  3. Use fluid typography and spacing with clamp() for smoother scaling between breakpoints while preserving accessibility via rem + vw.
  4. Make interactive elements touch-safe with 44px recommended targets, adequate spacing, clear labels, and mobile navigation patterns.
  5. Use container queries for reusable components that must respond to their own width instead of viewport width.
  6. Reserve media dimensions with aspect-ratio utilities and use safe-area utilities for notched devices and fixed mobile UI.

Key Gotchas

  • Unprefixed Tailwind classes apply at every size; breakpoint-prefixed utilities apply at that breakpoint and above.
  • Ordering classes desktop-first does not make the design desktop-first, but it often obscures intent and increases bugs.
  • Hover-only interactions fail on touch devices; pair hover states with focus, active, or explicit controls.
  • Videos and images without reserved aspect ratios can cause Cumulative Layout Shift.
  • Fixed bottom navigation must account for safe-area insets and add content padding to avoid overlap.

Reference Map

  • references/mobile-first-complete-guide.md [blocked] - Full original guide covering philosophy, breakpoints, fluid type/spacing, touch targets, container queries, layouts, responsive images/type, navigation, safe areas, mobile performance, testing, and responsive video patterns.

Response Guidance

  • Preserve the user's existing framework, library, and tooling choices unless there is a clear compatibility or performance reason to suggest an alternative.
  • Give copy-pasteable code only for the exact task at hand; otherwise point to the relevant reference section.
  • Call out tradeoffs, failure modes, and verification steps for production workflows.
  • Prefer accessible, maintainable, measurable solutions over clever micro-optimizations.

來源與署名

來源:josiahsiegel/claude-plugin-marketplace位於plugins/tailwindcss-master/skills/tailwindcss-mobile-first提交5a1b112

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架