mobile-styling-nativewind
NativeWind Patterns
Quick Guide: NativeWind brings Tailwind CSS utility classes to React Native via
classNameprop. Styles compile toStyleSheet.createat build time with a lightweight runtime for conditional logic (dark mode, hover, focus). Always declare both light AND dark styles (no CSS cascade in RN). Usevars()for runtime theming with CSS variables. Platform prefixes (ios:,android:,native:) replacePlatform.selectfor styling. UseremapPropsfor third-party components with multiple style props; reservecssInteropfor components needing style-to-prop extraction.
<critical_requirements>
CRITICAL: Before Using This Skill
All code must follow project conventions in CLAUDE.md (kebab-case, named exports, import ordering,
import type, named constants)
(You MUST always declare BOTH light and dark styles -- className="text-black dark:text-white" not just className="dark:text-white" -- React Native has no CSS cascade)
(You MUST use remapProps for third-party components with multiple style props and cssInterop ONLY when style attributes need extraction to props -- NEVER use either for your own custom components)
(You MUST import "./global.css" at your app entry point -- without it no styles render)
(You MUST add /// <reference types="nativewind/types" /> in a nativewind-env.d.ts file for TypeScript className support)