-
Notifications
You must be signed in to change notification settings - Fork 18
/
tamagui.config.ts
78 lines (72 loc) · 1.78 KB
/
tamagui.config.ts
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
70
71
72
73
74
75
76
77
78
import { createAnimations } from "@tamagui/animations-react-native";
import { config as tamaguiConfig } from "@tamagui/config";
import { createMedia } from "@tamagui/react-native-media-driver";
import { shorthands } from "@tamagui/shorthands";
import { tokens } from "@tamagui/themes";
import { createTamagui, createTokens } from "tamagui";
import { bodyFont } from "./src/styles/body-fonts";
import { themes } from "./src/styles/theme";
const animations = createAnimations({
bouncy: {
type: "spring",
damping: 10,
mass: 0.9,
stiffness: 100,
},
lazy: {
type: "spring",
damping: 20,
stiffness: 60,
},
quick: {
type: "spring",
damping: 20,
mass: 1.2,
stiffness: 250,
},
});
const config = createTamagui({
animations,
defaultTheme: "dark",
shouldAddPrefersColorThemes: false,
themeClassNameOnRoot: false,
shorthands,
fonts: {
...tamaguiConfig.fonts,
body: bodyFont,
},
themes,
tokens: createTokens({
...tokens,
size: {
...tokens.size,
0: 0,
0.25: 8,
0.5: 12,
0.75: 16,
},
}),
media: createMedia({
xs: { maxWidth: 660 },
sm: { maxWidth: 800 },
md: { maxWidth: 1020 },
lg: { maxWidth: 1280 },
xl: { maxWidth: 1420 },
xxl: { maxWidth: 1600 },
gtXs: { minWidth: 660 + 1 },
gtSm: { minWidth: 800 + 1 },
gtMd: { minWidth: 1020 + 1 },
gtLg: { minWidth: 1280 + 1 },
short: { maxHeight: 820 },
tall: { minHeight: 820 },
hoverNone: { hover: "none" },
pointerCoarse: { pointer: "coarse" },
}),
});
export type AppConfig = typeof config;
declare module "tamagui" {
// overrides TamaguiCustomConfig so your custom types
// work everywhere you import `tamagui`
interface TamaguiCustomConfig extends AppConfig {}
}
export default config;