/capacitor-ui:tailwind-capacitorfrom capacitor-ui
Sets up Tailwind CSS v4 in Capacitor apps with CSS-first config, safe-area utilities, platform variants, and handles v3-to-v4 upgrades. Use when adding Tailwind to a Capacitor project or fixing v4 rendering issues on older iOS.
Ships in capacitor-ui. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
TRIGGER when:
tailwind.config.js edits have no effect (v4 is CSS-first)Do not use:
konsta-ui--ion-* variables: ionic-designsafe-area-handlingcapacitor-keyboardframework-to-capacitortailwindcss 4.x is latest (4.3.x); 3.4.x on v3-lts.tailwind.config.js is not read unless you add @config "./tailwind.config.js";.@property, color-mix(), cascade layers, oklch).Decision: if the iOS deployment target (or real user base) includes iOS < 16.4, ask the user: stay on Tailwind 3.4, or raise the minimum OS. Do not silently ship v4.
Use the selected project and its installed dependencies. Package installation and migration tools execute code; limit them to the requested setup or upgrade, preserve the lockfile and existing changes, and review generated edits before running changed build scripts.
npm ls tailwindcss, tailwind.config.*, postcss.config.*, bundler config, main CSS file, ios/App/App.xcodeproj IPHONEOS_DEPLOYMENT_TARGET, presence of Ionic or Konsta.Only load a reference when its topic is in play.
npm i tailwindcss @tailwindcss/vite
// vite.config.ts
import { defineConfig } from 'vite';
import tailwindcss from '@tailwindcss/vite';
export default defineConfig({ plugins: [tailwindcss() /* + framework plugin */] });
/* src/styles.css */
@import "tailwindcss";
@custom-variant dark (&:where(.dark, .dark *));
@custom-variant ios (&:where(.plt-ios, .plt-ios *));
@custom-variant android (&:where(.plt-android, .plt-android *));
@theme {
--color-brand: oklch(0.55 0.2 265);
--font-sans: system-ui, -apple-system, "Roboto", sans-serif;
}
@utility pt-safe { padding-top: env(safe-area-inset-top); }
@utility pb-safe { padding-bottom: env(safe-area-inset-bottom); }
@utility px-safe { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
Other toolchains: PostCSS (Angular, webpack, Next) -> npm i tailwindcss @tailwindcss/postcss and postcss.config.mjs { plugins: { "@tailwindcss/postcss": {} } }; standalone -> @tailwindcss/cli. Angular CLI 17+ reads .postcssrc.json.
// main.ts: platform class for ios:/android: variants
import { Capacitor } from '@capacitor/core';
document.documentElement.classList.add(`plt-${Capacitor.getPlatform()}`); // plt-ios | plt-android | plt-web
Add viewport-fit=cover to the viewport meta or the safe-area utilities resolve to 0.
.gitignore). Classes in node_modules or outside the project root need @source "../path";. Dynamic class names (`bg-${color}-500`) are never generated; map to full class strings.hover: only applies on devices with (hover: hover), so sticky hover on touch is solved by default. Use active: for press feedback.currentColor, ring is 1px, shadow-sm/shadow and rounded-sm/rounded scales shifted, outline-none -> outline-hidden. The upgrade tool renames most; review visually.@layer theme, base, components, utilities; @import "tailwindcss/theme.css" layer(theme); @import "tailwindcss/utilities.css" layer(utilities);) or load Ionic CSS after Tailwind.konsta/<fw>/theme.css; follow konsta-ui instead of duplicating setup.100vh for full-screen layouts; use h-dvh (v4 has dvh/svh/lvh utilities) or a flex shell.env() as 0; Capacitor 8 SystemBars injects --safe-area-inset-*. For Android robustness, use @utility pt-safe { padding-top: var(--safe-area-inset-top, env(safe-area-inset-top)); } (see safe-area-handling).npm run build succeeds; built CSS contains your utilities: grep -c "pt-safe" dist/assets/*.css.npx cap sync and run on: oldest supported iOS version (check colors, gradients, shadows render), current iPhone, Android 15/16.ios:/android: variants by inspecting <html class>.grep -rn "@tailwind base\|@tailwind components\|@tailwind utilities\|require('tailwindcss')" src postcss.config.* 2>/dev/null returns nothing.| Error / symptom | Cause | Fix |
|---|---|---|
[postcss] It looks like you're trying to use tailwindcss directly as a PostCSS plugin. The PostCSS plugin has moved to a separate package | v3-style PostCSS config with v4 | Use @tailwindcss/postcss (or @tailwindcss/vite) |
| No styles at all | Missing @import "tailwindcss" or bundler plugin | Add both |
Cannot apply unknown utility class in @apply | Custom class not defined via @utility, or CSS module / Vue <style> without theme reference | Define with @utility; add @reference "../styles.css"; in the scoped style |
tailwind.config.js theme changes ignored | v4 does not auto-load JS config | Move to @theme, or add @config |
| Transparent/missing colors on some iPhones | iOS < 16.4 lacks features v4 uses | Raise min iOS or stay on 3.4 |
dark: follows OS, ignores toggle | Default dark variant is media-based | Add @custom-variant dark (&:where(.dark, .dark *)); |
| Upgrade tool fails: requires Node | @tailwindcss/upgrade needs Node 20+ | Upgrade Node (Capacitor 9 needs 24+ anyway) |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub cap-go/capgo-skills --plugin capacitor-ui5 skills in this plugin
/capacitor-ios-resizabilityMakes a Capacitor iOS app work in windows that resize while running (iPad Split View, Slide Over, Stage Manager, windowed apps, the foldable iPhone). Audits the web layer (viewport, `100vh`, device sniffing, `screen.width`, `window.orientation`, cached safe-area insets) and native code in the app and node_modules plugins (`UIScreen.main`, `interfaceOrientation`, `userInterfaceIdiom`, `keyWindow`, AppDelegate lifecycle, hard-coded bar heights), then applies trait-, window- and scene-based replacements. Checks Info.plist `UIRequiresFullScreen` (ignored on iOS 27, TN3192), iPad orientations, launch screen (ITMS-90870) and the UIScene lifecycle (Capacitor 8.5+). Use for "support iPad multitasking", "Stage Manager layout broken", "app does not resize", "foldable iPhone", or a plugin overlay mis-sized in split view. Do not use for notch padding only (safe-area-handling) or the SceneDelegate migration (capacitor-uiscene-migration)./ionic-designBuilds and reviews Ionic Framework UI in Capacitor apps (Ionic 9 current, Ionic 8 still common) - page structure (`ion-header`/`ion-content`/`ion-footer`), lists, modern form syntax (`label`/`labelPlacement` on `ion-input`/`ion-select`), sheet modals, tabs + `ion-router-outlet`, CSS variable theming, dark palettes (`palettes/dark.system.css`, `.ion-palette-dark`), iOS vs MD mode, and Ionic 8 -> 9 breaking changes (React Router 6, Vue Router 5, Angular 18-22 zoneless, removed `ion-picker-legacy`, boolean `autocorrect`, `npx @ionic/migrate`). Use when writing Ionic components, theming an Ionic app, fixing platform-mode styling, or upgrading @ionic/react, @ionic/vue, @ionic/angular. Do not use for Konsta UI (konsta-ui), Tailwind setup (tailwind-capacitor), raw safe-area CSS (safe-area-handling), keyboard resize (capacitor-keyboard), or Ionic Appflow/Enterprise migrations (ionic-appflow-migration, ionic-enterprise-sdk-migration)./konsta-uiBuilds Capacitor app UI with Konsta UI v5 (Tailwind CSS v4-based iOS and Material components for React 19, Vue 3, Svelte 5) - CSS-first setup (`@import 'tailwindcss'; @import 'konsta/react/theme.css';`), `--color-brand-*` colors in `@theme`, `<App theme="ios|material|parent" safeAreas dark>`, `KonstaProvider` when mixing with Ionic, `ios:`/`material:` variants, `pt-safe`/`no-safe-areas` utilities, `k-md-vibrant`/`k-md-monochrome`, and migrating from Konsta v3/v4 `konstaConfig` in `tailwind.config.js`. Use when installing or upgrading Konsta, components render unstyled, theme or dark mode does not switch, or Navbar/Tabbar overlap system bars. Do not use for Ionic components (ionic-design), plain Tailwind setup without Konsta (tailwind-capacitor), or native safe-area/edge-to-edge config (safe-area-handling)./safe-area-handlingFixes notch, Dynamic Island, home indicator, display cutout, and system bar overlap in Capacitor apps. Covers `viewport-fit=cover` + `env(safe-area-inset-*)`, the Capacitor 8 SystemBars core plugin (`insetsHandling`, injected `--safe-area-inset-*` CSS variables for Android WebView < 140, removal of `android.adjustMarginsForEdgeToEdge`), Android 15/16 enforced edge-to-edge (`overlaysWebView` and `backgroundColor` of @capacitor/status-bar no longer work at targetSdk 36), iOS `contentInset`, and insets that change at runtime on rotation, iPad/foldable resizable windows. Use when headers sit under the status bar, tab bars hide behind the gesture bar, `env()` returns 0 on Android, or layout broke after upgrading to Capacitor 8 / targetSdk 35+. Do not use for keyboard overlap (capacitor-keyboard), Ionic/Konsta component theming (ionic-design, konsta-ui), Tailwind utility setup (tailwind-capacitor), or iOS multi-window/resizability adoption (capacitor-ios-resizability).Other plugins' skills for the same job