2023-01-16 14:34:15 +00:00
|
|
|
import { createFont, createTamagui } from '@tamagui/core'
|
|
|
|
import { createInterFont } from '@tamagui/font-inter'
|
|
|
|
import { createMedia } from '@tamagui/react-native-media-driver'
|
|
|
|
import { shorthands } from '@tamagui/shorthands'
|
2023-01-09 21:14:58 +00:00
|
|
|
|
2023-01-18 13:15:51 +00:00
|
|
|
import { animations } from './animations'
|
2023-01-16 14:34:15 +00:00
|
|
|
import { themes } from './themes'
|
|
|
|
import { tokens } from './tokens'
|
2023-01-09 21:14:58 +00:00
|
|
|
|
2023-03-22 09:57:25 +00:00
|
|
|
import type {
|
|
|
|
ColorTokens,
|
|
|
|
GetStyledVariants,
|
|
|
|
TamaguiComponent,
|
|
|
|
} from '@tamagui/core'
|
|
|
|
|
2023-01-18 15:39:50 +00:00
|
|
|
export type Conf = typeof config
|
|
|
|
|
|
|
|
declare module '@tamagui/core' {
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
|
|
interface TamaguiCustomConfig extends Conf {}
|
|
|
|
}
|
|
|
|
|
2023-01-16 14:34:15 +00:00
|
|
|
export const config = createTamagui({
|
|
|
|
fonts: {
|
2023-03-22 09:57:25 +00:00
|
|
|
sans: createInterFont({
|
|
|
|
size: {},
|
|
|
|
weight: {},
|
|
|
|
letterSpacing: {},
|
|
|
|
face: {
|
|
|
|
400: { normal: 'Inter' },
|
|
|
|
500: { normal: 'Inter' },
|
|
|
|
600: { normal: 'InterBold' },
|
|
|
|
},
|
|
|
|
}),
|
|
|
|
mono: createFont({
|
2023-04-05 14:31:35 +00:00
|
|
|
family:
|
|
|
|
'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;',
|
2023-03-22 09:57:25 +00:00
|
|
|
weight: {},
|
|
|
|
letterSpacing: {},
|
|
|
|
size: {},
|
|
|
|
lineHeight: {},
|
|
|
|
}),
|
2023-04-11 18:52:18 +00:00
|
|
|
// Tamagui requires this... weird
|
|
|
|
body: createInterFont({}),
|
2023-01-16 14:34:15 +00:00
|
|
|
},
|
|
|
|
themes,
|
2023-02-10 16:25:13 +00:00
|
|
|
tokens: {
|
|
|
|
colors: {
|
2023-03-13 18:22:51 +00:00
|
|
|
...tokens.color,
|
2023-02-10 16:25:13 +00:00
|
|
|
},
|
2023-03-13 18:22:51 +00:00
|
|
|
...tokens,
|
2023-02-10 16:25:13 +00:00
|
|
|
},
|
|
|
|
shouldAddPrefersColorThemes: true,
|
2023-01-16 14:34:15 +00:00
|
|
|
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' },
|
2023-03-13 18:22:51 +00:00
|
|
|
pointerCoarse: { pointer: 'coarse' },
|
2023-01-16 14:34:15 +00:00
|
|
|
}),
|
|
|
|
shorthands,
|
2023-03-13 18:22:51 +00:00
|
|
|
animations,
|
2023-01-16 14:34:15 +00:00
|
|
|
})
|
2023-03-22 09:57:25 +00:00
|
|
|
|
|
|
|
export type TextColor<
|
|
|
|
C extends TamaguiComponent,
|
|
|
|
K extends keyof V,
|
|
|
|
V extends GetStyledVariants<C> = GetStyledVariants<C>
|
|
|
|
> = {
|
|
|
|
[P in V[K] & string]: ColorTokens
|
|
|
|
}
|