This handles the full NativeWind v4 setup for Expo projects, from initial config through dark mode and third-party component styling. It walks you through the critical three-path setup (CSS file location, Metro input, app import) and includes a deterministic audit prompt you can drop into Claude to diagnose existing repos. The troubleshooting workflow is solid: always clear Metro cache first, verify Tailwind CLI compiles, then check path consistency before chasing platform quirks. Useful if you've hit the "className not applying" wall or need to configure cssInterop for library components. The checklist format makes it easy to validate you haven't missed a step in babel.config.js or metro.config.js.
npx -y skills add tristanmanchester/agent-skills --skill styling-nativewind-v4-expo --agent claude-codeInstalls into .claude/skills of the current project.
presets: [require("nativewind/preset")] in tailwind.config.js.global.css) and keep its path consistent across:
metro.config.js → withNativeWind(..., { input: "./global.css" })import "./global.css" (or import "../global.css" from app/_layout.tsx)nativewind/babel in Babel presets and set jsxImportSource: "nativewind" on babel-preset-expo.npx expo start --clear.Copy/paste and tick off:
references/expo-setup.md.tailwind.config.js (content globs + nativewind/preset).global.css with Tailwind directives.babel.config.js (jsxImportSource + nativewind/babel).metro.config.js (wrap config with withNativeWind, set input).app.json → expo.web.bundler = "metro".nativewind-env.d.ts with /// <reference types="nativewind/types" />.npx expo start --clear.app/_layout.tsx → import CSS there (relative path is typically ../global.css).App.tsx → import CSS there (./global.css).If unsure, search package.json for "main": "expo-router/entry".
Accept className, merge defaults, and optionally use a class-variance helper.
Read: references/patterns.md
Use remapProps (multiple style props) or cssInterop (map a class prop to a style prop).
Read: references/third-party-components.md
Use useColorScheme / colorScheme.set() and CSS variables via vars().
Read: references/theming-dark-mode.md
On Expo Router, do not add your own SafeAreaProvider (Router already does).
Use p-safe, pt-safe, etc.
If you are not using Expo Router, wrap the root with SafeAreaProvider.
npx expo start --clear.metro.config.js input points to ittailwind.config.js content globs include every directory that contains className strings.Read: references/troubleshooting.md
Use this prompt to perform a deterministic audit of an existing repo:
You are auditing an Expo React Native repo for NativeWind v4 correctness.
1) Identify whether the project uses Expo Router (app/ directory + package.json main = expo-router/entry) or classic App.tsx.
2) Check and report on:
- tailwind.config.js: presets + content globs
- global.css: Tailwind directives exist
- babel.config.js: jsxImportSource nativewind + nativewind/babel in presets; preserve any existing required plugins
- metro.config.js: withNativeWind wrapper; input path matches the CSS file
- app.json: web bundler metro when web is used
- TypeScript: nativewind-env.d.ts present and correctly named
3) For every issue, propose the minimal diff needed to fix it.
4) End by listing the exact commands to restart Metro and validate the fix.
sickn33/antigravity-awesome-skills
moizibnyousaf/ai-agent-skills
github/awesome-copilot