-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Expand file tree
/
Copy pathDarkTheme.tsx
More file actions
63 lines (60 loc) · 2.27 KB
/
DarkTheme.tsx
File metadata and controls
63 lines (60 loc) · 2.27 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
import color from 'color';
import { LightTheme } from './LightTheme';
import { Colors, tokens } from './tokens';
import type { Theme } from '../../types';
const { palette, opacity } = tokens.md.ref;
export const DarkTheme: Theme = {
...LightTheme,
dark: true,
colors: {
primary: palette.primary80,
primaryContainer: palette.primary30,
secondary: palette.secondary80,
secondaryContainer: palette.secondary30,
tertiary: palette.tertiary80,
tertiaryContainer: palette.tertiary30,
surface: palette.neutral10,
surfaceVariant: palette.neutralVariant30,
surfaceDisabled: color(palette.neutral90)
.alpha(opacity.level2)
.rgb()
.string(),
background: palette.neutral10,
error: palette.error80,
errorContainer: palette.error30,
onPrimary: palette.primary20,
onPrimaryContainer: palette.primary90,
onSecondary: palette.secondary20,
onSecondaryContainer: palette.secondary90,
onTertiary: palette.tertiary20,
onTertiaryContainer: palette.tertiary90,
onSurface: palette.neutral90,
onSurfaceVariant: palette.neutralVariant80,
onSurfaceDisabled: color(palette.neutral90)
.alpha(opacity.level4)
.rgb()
.string(),
onError: palette.error20,
onErrorContainer: palette.error80,
onBackground: palette.neutral90,
outline: palette.neutralVariant60,
outlineVariant: palette.neutralVariant30,
inverseSurface: palette.neutral90,
inverseOnSurface: palette.neutral20,
inversePrimary: palette.primary40,
shadow: palette.neutral0,
scrim: palette.neutral0,
backdrop: color(Colors.neutralVariant20).alpha(0.4).rgb().string(),
elevation: {
level0: 'transparent',
// Note: Color values with transparency cause RN to transfer shadows to children nodes
// instead of View component in Surface. Providing solid background fixes the issue.
// Opaque color values generated with `palette.primary80` used as background
level1: 'rgb(37, 35, 42)', // palette.primary80, alpha 0.05
level2: 'rgb(44, 40, 49)', // palette.primary80, alpha 0.08
level3: 'rgb(49, 44, 56)', // palette.primary80, alpha 0.11
level4: 'rgb(51, 46, 58)', // palette.primary80, alpha 0.12
level5: 'rgb(52, 49, 63)', // palette.primary80, alpha 0.14
},
},
};