Skip to content

Commit 55e997b

Browse files
committed
chore: Add custom primary color in tailwind.theme.js
1 parent d70f1f6 commit 55e997b

File tree

6 files changed

+26
-25
lines changed

6 files changed

+26
-25
lines changed

apps/expo/app/ExpoRootLayout.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
import { Stack } from 'expo-router'
22
import UniversalAppProviders from '@app/core/screens/UniversalAppProviders'
33
import UniversalRootLayout from '@app/core/screens/UniversalRootLayout'
4+
import { NativeWindStyleSheet } from 'nativewind'
45

56
// -i- Expo Router's layout setup is much simpler than Next.js's layout setup
67
// -i- Since Expo doesn't require a custom document setup or server component root layout
78
// -i- Use this file to apply your Expo specific layout setup:
89
// -i- like rendering our Universal Layout and App Providers
910

11+
/* --- Settings -------------------------------------------------------------------------------- */
12+
13+
NativeWindStyleSheet.setOutput({
14+
default: 'native',
15+
})
16+
1017
/* --- <ExpoRootLayout> ------------------------------------------------------------------------ */
1118

1219
export default function ExpoRootLayout() {

apps/expo/tailwind.config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ const { universalTheme } = require('@app/core/tailwind.theme')
33
/** @type {import('tailwindcss').Config} */
44
module.exports = {
55
content: [
6-
'./app/**/*.{js,jsx,ts,tsx}',
7-
'../../features/**/*.{js,jsx,ts,tsx}',
8-
'../../packages/**/*.{js,jsx,ts,tsx}',
6+
'../../apps/**/*.tsx',
7+
'../../features/**/*.tsx',
8+
'../../packages/**/*.tsx',
99
],
1010
plugins: [],
1111
theme: {
12-
//...universalTheme,
12+
...universalTheme,
1313
},
1414
}

apps/next/tailwind.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ const { universalTheme } = require('@app/core/tailwind.theme')
33
/** @type {import('tailwindcss').Config} */
44
module.exports = {
55
content: [
6-
'./app/**/*.{js,jsx,ts,tsx}',
7-
'../../features/**/*.{js,jsx,ts,tsx}',
8-
'../../packages/**/*.{js,jsx,ts,tsx}',
6+
'../../apps/**/*.tsx',
7+
'../../features/**/*.tsx',
8+
'../../packages/**/*.tsx',
99
],
1010
plugins: [require('nativewind/tailwind/css')],
1111
important: 'html',

features/app-core/components/styled.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { styled } from 'nativewind'
22
import { Text as RNText, View as RNView } from 'react-native'
3-
import { Link as UniversalLink } from './Link'
3+
import { Link as UniversalLink } from '../navigation/Link'
44

55
/* --- Primitives ------------------------------------------------------------------------------ */
66

@@ -9,9 +9,9 @@ export const Text = styled(RNText, '')
99

1010
/* --- Typography ------------------------------------------------------------------------------ */
1111

12-
export const H1 = styled(RNText, 'font-bold text-2xl')
13-
export const H2 = styled(RNText, 'font-bold text-xl')
14-
export const H3 = styled(RNText, 'font-bold text-lg')
12+
export const H1 = styled(RNText, 'font-bold text-2xl text-primary-500')
13+
export const H2 = styled(RNText, 'font-bold text-xl text-primary-500')
14+
export const H3 = styled(RNText, 'font-bold text-lg text-primary-500')
1515

1616
export const P = styled(RNText, 'text-base')
1717

features/app-core/tailwind.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ const { universalTheme } = require('./tailwind.theme')
33
/** @type {import('tailwindcss').Config} */
44
module.exports = {
55
content: [
6-
'./**/*.{js,jsx,ts,tsx}',
6+
'../../apps/**/*.tsx',
7+
'../../features/**/*.tsx',
8+
'../../packages/**/*.tsx',
79
],
810
plugins: [],
911
theme: {

features/app-core/tailwind.theme.js

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,13 @@
1+
const colors = require('tailwindcss/colors')
2+
13
/** @type {import('tailwindcss').Config['theme']} */
24
const universalTheme = {
35
// -i- Extend default tailwind theme here
46
// -i- Reference this theme in the tailwind.config.js files in apps/expo, apps/next, features/app-core and other package or feature folders
57
extend: {
6-
// colors: {
7-
// primary: {
8-
// 100: '#FFA8E2',
9-
// 200: '#FF8CD4',
10-
// 300: '#FF70C6',
11-
// 400: '#FF54B8',
12-
// 500: '#FF38AA',
13-
// 600: '#FF1C9C',
14-
// 700: '#FF0090',
15-
// 800: '#E60082',
16-
// 900: '#CC0074',
17-
// },
18-
// }
8+
colors: {
9+
primary: colors.green,
10+
},
1911
}
2012
}
2113

0 commit comments

Comments
 (0)