tailwind-capacitor
Guide to using Tailwind CSS in Capacitor mobile apps. Covers mobile-first design, touch targets, safe areas, dark mode, and performance optimization. Use this skill when users want to style Capacitor apps with Tailwind.
What this skill does
# Tailwind CSS for Capacitor Apps
Build beautiful mobile apps with Tailwind CSS and Capacitor.
## When to Use This Skill
- User is using Tailwind in Capacitor app
- User asks about mobile styling
- User needs responsive mobile design
- User wants dark mode with Tailwind
- User needs safe area handling
## Getting Started
### Installation
```bash
npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -p
```
### Configuration
```javascript
// tailwind.config.js
/** @type {import('tailwindcss').Config} */
export default {
content: [
'./index.html',
'./src/**/*.{js,ts,jsx,tsx,vue,svelte}',
],
theme: {
extend: {
// Mobile-first spacing
spacing: {
'safe-top': 'env(safe-area-inset-top)',
'safe-bottom': 'env(safe-area-inset-bottom)',
'safe-left': 'env(safe-area-inset-left)',
'safe-right': 'env(safe-area-inset-right)',
},
// Minimum touch targets (44px)
minHeight: {
'touch': '44px',
},
minWidth: {
'touch': '44px',
},
},
},
plugins: [],
};
```
### Import Styles
```css
/* src/index.css */
@tailwind base;
@tailwind components;
@tailwind utilities;
/* Mobile-specific base styles */
@layer base {
html {
/* Prevent text size adjustment on orientation change */
-webkit-text-size-adjust: 100%;
/* Smooth scrolling */
scroll-behavior: smooth;
/* Prevent pull-to-refresh on overscroll */
overscroll-behavior: none;
}
body {
/* Prevent text selection on long press */
-webkit-user-select: none;
user-select: none;
/* Disable callout on long press */
-webkit-touch-callout: none;
/* Prevent elastic scrolling on iOS */
position: fixed;
width: 100%;
height: 100%;
overflow: hidden;
}
/* Enable text selection in inputs */
input, textarea {
-webkit-user-select: text;
user-select: text;
}
}
```
## Safe Area Handling
### Utility Classes
```javascript
// tailwind.config.js
theme: {
extend: {
padding: {
'safe': 'env(safe-area-inset-bottom)',
'safe-t': 'env(safe-area-inset-top)',
'safe-b': 'env(safe-area-inset-bottom)',
'safe-l': 'env(safe-area-inset-left)',
'safe-r': 'env(safe-area-inset-right)',
},
margin: {
'safe': 'env(safe-area-inset-bottom)',
'safe-t': 'env(safe-area-inset-top)',
'safe-b': 'env(safe-area-inset-bottom)',
},
},
},
```
### Usage in Components
```tsx
// Header with safe area
function Header() {
return (
<header className="
fixed top-0 left-0 right-0
pt-safe-t /* Padding for notch */
bg-white dark:bg-gray-900
border-b border-gray-200
">
<div className="px-4 h-14 flex items-center">
<h1 className="font-semibold">App Title</h1>
</div>
</header>
);
}
// Footer with safe area
function Footer() {
return (
<footer className="
fixed bottom-0 left-0 right-0
pb-safe-b /* Padding for home indicator */
bg-white dark:bg-gray-900
border-t border-gray-200
">
<div className="px-4 h-14 flex items-center justify-around">
<button className="min-h-touch min-w-touch">Home</button>
<button className="min-h-touch min-w-touch">Search</button>
<button className="min-h-touch min-w-touch">Profile</button>
</div>
</footer>
);
}
// Main content
function Main() {
return (
<main className="
pt-safe-t /* Account for header + notch */
pb-safe-b /* Account for footer + home indicator */
h-screen
overflow-y-auto
overscroll-none
">
{/* Content */}
</main>
);
}
```
## Touch-Friendly Design
### Minimum Touch Targets
```tsx
// Apple HIG recommends 44x44pt minimum
function TouchableButton() {
return (
<button className="
min-h-[44px] min-w-[44px]
px-4 py-3
flex items-center justify-center
active:bg-gray-100
rounded-lg
">
Tap Me
</button>
);
}
// Icon button with proper touch target
function IconButton() {
return (
<button className="
h-11 w-11 /* 44px */
flex items-center justify-center
rounded-full
active:bg-gray-100
">
<svg className="w-6 h-6" /> {/* Icon smaller than touch area */}
</button>
);
}
```
### Touch Feedback
```css
/* Add to index.css */
@layer utilities {
.touch-feedback {
@apply transition-colors duration-75;
}
.touch-feedback:active {
@apply bg-black/5 dark:bg-white/5;
}
}
```
```tsx
<button className="touch-feedback p-4 rounded-lg">
With Feedback
</button>
```
### Disable Hover on Touch
```javascript
// tailwind.config.js
module.exports = {
future: {
hoverOnlyWhenSupported: true, // Disables hover on touch devices
},
};
```
Or use media query:
```css
@media (hover: hover) {
.hover-only:hover {
@apply bg-gray-100;
}
}
```
## Dark Mode
### System Dark Mode
```javascript
// tailwind.config.js
module.exports = {
darkMode: 'media', // or 'class' for manual control
};
```
### Manual Dark Mode
```javascript
// tailwind.config.js
module.exports = {
darkMode: 'class',
};
```
```typescript
// theme.ts
import { Preferences } from '@capacitor/preferences';
type Theme = 'light' | 'dark' | 'system';
async function setTheme(theme: Theme) {
await Preferences.set({ key: 'theme', value: theme });
if (theme === 'system') {
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
document.documentElement.classList.toggle('dark', prefersDark);
} else {
document.documentElement.classList.toggle('dark', theme === 'dark');
}
}
// Listen for system changes
window.matchMedia('(prefers-color-scheme: dark)')
.addEventListener('change', (e) => {
const theme = await Preferences.get({ key: 'theme' });
if (theme.value === 'system') {
document.documentElement.classList.toggle('dark', e.matches);
}
});
```
### Dark Mode Components
```tsx
function Card() {
return (
<div className="
bg-white dark:bg-gray-800
border border-gray-200 dark:border-gray-700
rounded-xl
shadow-sm dark:shadow-none
">
<h3 className="text-gray-900 dark:text-white">
Card Title
</h3>
<p className="text-gray-600 dark:text-gray-400">
Card content
</p>
</div>
);
}
```
## Mobile Patterns
### Pull to Refresh Container
```tsx
function PullToRefresh({ onRefresh, children }) {
return (
<div className="
h-full
overflow-y-auto
overscroll-contain
touch-pan-y
">
{children}
</div>
);
}
```
### Bottom Sheet
```tsx
function BottomSheet({ isOpen, onClose, children }) {
return (
<>
{/* Backdrop */}
<div
className={`
fixed inset-0
bg-black/50
transition-opacity duration-300
${isOpen ? 'opacity-100' : 'opacity-0 pointer-events-none'}
`}
onClick={onClose}
/>
{/* Sheet */}
<div
className={`
fixed left-0 right-0 bottom-0
bg-white dark:bg-gray-900
rounded-t-2xl
pb-safe-b
transition-transform duration-300 ease-out
${isOpen ? 'translate-y-0' : 'translate-y-full'}
`}
>
{/* Handle */}
<div className="flex justify-center py-2">
<div className="w-10 h-1 bg-gray-300 rounded-full" />
</div>
{children}
</div>
</>
);
}
```
### Swipe Actions
```tsx
function SwipeableItem({ children, onDelete }) {
return (
<div className="relative overflow-hidden">
{/* Background action */}
<div className="
absolute inset-y-0 right-0
flex items-center
bg-red-500
px-4
">
<span className="text-white">Delete</span>
</div>
{/* Foreground content */}
<div className="
relative
bg-white dark:bg-gray-800
transform transition-traRelated in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.