Repository navigation
Expand file tree
/
Copy paththeme.ts
More file actions
69 lines (64 loc) · 1.72 KB
/
Copy paththeme.ts
File metadata and controls
69 lines (64 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import { Platform } from 'react-native';
import { fontFamilies } from './fonts';
// The one Theme every screen takes its look from (ADR 0002). A Derived App gets its
// look by replacing these values with ones extracted from its Reference Design.
export type Theme = {
colors: {
background: string;
surface: string;
text: string;
textMuted: string;
primary: string;
onPrimary: string;
link: string;
border: string;
danger: string;
onDanger: string;
focus: string;
};
fonts: { regular: string; medium: string; bold: string };
textSizes: { small: number; body: number; heading: number; title: number };
spacing: { xs: number; sm: number; md: number; lg: number; xl: number };
radius: { sm: number; md: number };
minTapTarget: number;
};
const shared = {
fonts: fontFamilies,
textSizes: { small: 14, body: 16, heading: 20, title: 28 },
spacing: { xs: 4, sm: 8, md: 16, lg: 24, xl: 32 },
radius: { sm: 6, md: 10 },
// 44pt is Apple's minimum tap target; Android's is 48dp.
minTapTarget: Platform.OS === 'android' ? 48 : 44,
};
export const lightTheme: Theme = {
...shared,
colors: {
background: '#F8FAFC',
surface: '#FFFFFF',
text: '#020617',
textMuted: '#475569',
primary: '#0F172A',
onPrimary: '#FFFFFF',
link: '#1E3A8A',
border: '#E2E8F0',
danger: '#DC2626',
onDanger: '#FFFFFF',
focus: '#0F172A',
},
};
export const darkTheme: Theme = {
...shared,
colors: {
background: '#020617',
surface: '#0F172A',
text: '#F8FAFC',
textMuted: '#94A3B8',
primary: '#E2E8F0',
onPrimary: '#0F172A',
link: '#93C5FD',
border: '#1E293B',
danger: '#F87171',
onDanger: '#020617',
focus: '#E2E8F0',
},
};