Skip to content

Commit 0733cfd

Browse files
committed
Bativewind init
1 parent c68999e commit 0733cfd

File tree

9 files changed

+511
-23
lines changed

9 files changed

+511
-23
lines changed

apps/mobile/App.tsx

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,15 @@
1-
import { StatusBar } from 'expo-status-bar';
2-
import { StyleSheet, Text, View } from 'react-native';
1+
import "./global.css";
2+
3+
import { StatusBar } from "expo-status-bar";
4+
import { Text, View } from "react-native";
35

46
export default function App() {
57
return (
6-
<View style={styles.container}>
7-
<Text>Open up App.tsx to start working on your app!</Text>
8+
<View className="flex-1 items-center justify-center bg-white">
9+
<Text className="text-xl font-bold text-blue-500">
10+
Welcome to Nativewind!
11+
</Text>
812
<StatusBar style="auto" />
913
</View>
1014
);
1115
}
12-
13-
const styles = StyleSheet.create({
14-
container: {
15-
flex: 1,
16-
backgroundColor: '#fff',
17-
alignItems: 'center',
18-
justifyContent: 'center',
19-
},
20-
});

apps/mobile/app.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"icon": "./assets/icon.png",
88
"userInterfaceStyle": "light",
99
"newArchEnabled": true,
10+
"bundler": "metro",
1011
"splash": {
1112
"image": "./assets/splash-icon.png",
1213
"resizeMode": "contain",

apps/mobile/babel.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = function (api) {
2+
api.cache(true);
3+
return {
4+
presets: [
5+
["babel-preset-expo", { jsxImportSource: "nativewind" }],
6+
"nativewind/babel",
7+
],
8+
};
9+
};

apps/mobile/global.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;

apps/mobile/metro.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
const { getDefaultConfig } = require("expo/metro-config");
2+
const { withNativeWind } = require('nativewind/metro');
3+
4+
const config = getDefaultConfig(__dirname)
5+
6+
module.exports = withNativeWind(config, { input: './global.css' })

apps/mobile/nativewind-env.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/// <reference types="nativewind/types" />

apps/mobile/package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,15 @@
1919
"expo-web-browser": "^15.0.10",
2020
"react": "19.1.0",
2121
"react-native": "0.81.5",
22-
"zustand": "^4.5.7"
22+
"zustand": "^4.5.7",
23+
"nativewind": "^4.2.1",
24+
"react-native-reanimated": "~3.17.5",
25+
"react-native-safe-area-context": "5.4.0"
2326
},
2427
"devDependencies": {
2528
"@types/react": "^19.1.0",
29+
"prettier-plugin-tailwindcss": "^0.5.14",
30+
"tailwindcss": "^3.4.18",
2631
"typescript": "~5.9.2"
2732
},
2833
"private": true

apps/mobile/tailwind.config.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/** @type {import('tailwindcss').Config} */
2+
module.exports = {
3+
content: ["./App.{js,ts,jsx,tsx}", "./**/*.{js,ts,jsx,tsx}"],
4+
theme: {
5+
extend: {
6+
colors: {
7+
posthog: {
8+
50: "#fef2f2",
9+
100: "#fee2e2",
10+
200: "#fecaca",
11+
300: "#fca5a5",
12+
400: "#f87171",
13+
500: "#ef4444",
14+
600: "#dc2626",
15+
700: "#b91c1c",
16+
800: "#991b1b",
17+
900: "#7f1d1d",
18+
},
19+
dark: {
20+
bg: "#0a0a0a",
21+
surface: "#1a1a1a",
22+
border: "#2a2a2a",
23+
text: "#e5e5e5",
24+
"text-muted": "#a3a3a3",
25+
},
26+
},
27+
fontFamily: {
28+
mono: ["JetBrains Mono", "Consolas", "Monaco", "monospace"],
29+
},
30+
},
31+
},
32+
plugins: [],
33+
darkMode: "class",
34+
};

0 commit comments

Comments
 (0)