Loading...
Loading...
Sets up and uses NativeWind v4 (Tailwind CSS v3) in Expo React Native apps, including Expo Router. Configures tailwind.config.js, global.css, babel.config.js (jsxImportSource + nativewind/babel), metro.config.js (withNativeWind + input), and app.json (web bundler metro). Troubleshoots “className not applying”, Tailwind CLI compilation, and Metro cache issues. Implements reusable components/variants, dark mode + theming via CSS variables (vars/useColorScheme), and third-party component styling (remapProps/cssInterop). Use when working on Expo projects using NativeWind v4, Tailwind-style className utilities, or when debugging NativeWind configuration.
npx skill4agent add tristanmanchester/agent-skills styling-nativewind-v4-expopresets: [require("nativewind/preset")]tailwind.config.jsglobal.cssmetro.config.jswithNativeWind(..., { input: "./global.css" })import "./global.css"import "../global.css"app/_layout.tsxnativewind/babelpresetsjsxImportSource: "nativewind"babel-preset-exponpx expo start --clearreferences/expo-setup.mdtailwind.config.jsnativewind/presetglobal.cssbabel.config.jsnativewind/babelmetro.config.jswithNativeWindinputapp.jsonexpo.web.bundler = "metro"nativewind-env.d.ts/// <reference types="nativewind/types" />npx expo start --clearapp/_layout.tsx../global.cssApp.tsx./global.csspackage.json"main": "expo-router/entry"classNamereferences/patterns.mdremapPropscssInteropreferences/third-party-components.mduseColorSchemecolorScheme.set()vars()references/theming-dark-mode.mdSafeAreaProviderp-safept-safeSafeAreaProvidernpx expo start --clearmetro.config.jsinputtailwind.config.jscontentclassNamereferences/troubleshooting.mdYou 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.