Files
nativewind/website/docs/compilation/postcss-css.md
2022-05-12 14:09:17 +10:00

835 B

import StartCoding from "../_start-coding-components.md" import ReactNativeWebPreview from "./_react-native-web-0-18-preview.md"

PostCSS (CSS) 🔬

This preview feature allows you to use the PostCSS to generate CSS stylesheets. You can then use className to style your React Native Web components using CSS.

Setup

1. Setup Tailwind CSS

Follow the setup guide for Tailwind CLI.

2. Enable preview features

You will need to enable preview features on your TailwindProvider

import { TailwindProvider } from 'tailwindcss-react-native'

function MyAppsProviders ({ children }) {
  return (
-   <TailwindProvider>{children}</TailwindProvider>
+   <TailwindProvider preview={true}>{children}</TailwindProvider>
  )
}