init: 初始化模板项目
This commit is contained in:
28
packages/config/package.json
Normal file
28
packages/config/package.json
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"name": "@my/config",
|
||||
"version": "0.0.1",
|
||||
"sideEffects": [
|
||||
"*.css"
|
||||
],
|
||||
"private": true,
|
||||
"types": "./src",
|
||||
"main": "src/index.ts",
|
||||
"files": [
|
||||
"types",
|
||||
"dist"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "tamagui-build --skip-types",
|
||||
"watch": "tamagui-build --skip-types --watch"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tamagui/animations-react-native": "^1.132.18",
|
||||
"@tamagui/font-inter": "^1.132.18",
|
||||
"@tamagui/shorthands": "^1.132.18",
|
||||
"@tamagui/themes": "^1.132.18",
|
||||
"tamagui": "^1.132.18"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tamagui/build": "^1.132.18"
|
||||
}
|
||||
}
|
||||
36
packages/config/src/animations.ts
Normal file
36
packages/config/src/animations.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import { createAnimations } from '@tamagui/animations-react-native'
|
||||
|
||||
export const animations = createAnimations({
|
||||
'100ms': {
|
||||
type: 'timing',
|
||||
duration: 100,
|
||||
},
|
||||
bouncy: {
|
||||
damping: 9,
|
||||
mass: 0.9,
|
||||
stiffness: 150,
|
||||
},
|
||||
lazy: {
|
||||
damping: 18,
|
||||
stiffness: 50,
|
||||
},
|
||||
medium: {
|
||||
damping: 15,
|
||||
stiffness: 120,
|
||||
mass: 1,
|
||||
},
|
||||
slow: {
|
||||
damping: 15,
|
||||
stiffness: 40,
|
||||
},
|
||||
quick: {
|
||||
damping: 20,
|
||||
mass: 1.2,
|
||||
stiffness: 250,
|
||||
},
|
||||
tooltip: {
|
||||
damping: 10,
|
||||
mass: 0.9,
|
||||
stiffness: 100,
|
||||
},
|
||||
})
|
||||
45
packages/config/src/fonts.ts
Normal file
45
packages/config/src/fonts.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
import { createInterFont } from '@tamagui/font-inter'
|
||||
|
||||
export const headingFont = createInterFont({
|
||||
size: {
|
||||
6: 15,
|
||||
},
|
||||
transform: {
|
||||
6: 'uppercase',
|
||||
7: 'none',
|
||||
},
|
||||
weight: {
|
||||
6: '400',
|
||||
7: '700',
|
||||
},
|
||||
color: {
|
||||
6: '$colorFocus',
|
||||
7: '$color',
|
||||
},
|
||||
letterSpacing: {
|
||||
5: 2,
|
||||
6: 1,
|
||||
7: 0,
|
||||
8: -1,
|
||||
9: -2,
|
||||
10: -3,
|
||||
12: -4,
|
||||
14: -5,
|
||||
15: -6,
|
||||
},
|
||||
face: {
|
||||
700: { normal: 'InterBold' },
|
||||
},
|
||||
})
|
||||
|
||||
export const bodyFont = createInterFont(
|
||||
{
|
||||
face: {
|
||||
700: { normal: 'InterBold' },
|
||||
},
|
||||
},
|
||||
{
|
||||
sizeSize: (size) => Math.round(size * 1.1),
|
||||
sizeLineHeight: (size) => Math.round(size * 1.1 + (size > 20 ? 10 : 10)),
|
||||
}
|
||||
)
|
||||
1
packages/config/src/index.ts
Normal file
1
packages/config/src/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from './tamagui.config'
|
||||
17
packages/config/src/tamagui.config.ts
Normal file
17
packages/config/src/tamagui.config.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { defaultConfig } from '@tamagui/config/v4'
|
||||
import { createTamagui } from 'tamagui'
|
||||
import { bodyFont, headingFont } from './fonts'
|
||||
import { animations } from './animations'
|
||||
|
||||
export const config = createTamagui({
|
||||
...defaultConfig,
|
||||
animations,
|
||||
fonts: {
|
||||
body: bodyFont,
|
||||
heading: headingFont,
|
||||
},
|
||||
settings:{
|
||||
...defaultConfig.settings,
|
||||
onlyAllowShorthands: false
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user