-
Notifications
You must be signed in to change notification settings - Fork 0
/
tailwind.config.js
138 lines (135 loc) · 3.29 KB
/
tailwind.config.js
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
import { fontFamily, typography } from "tailwindcss/defaultTheme";
/** @type {import('tailwindcss').Config} */
const config = {
darkMode: ["class"],
content: ["./src/**/*.{html,js,svelte,md,ts}"],
safelist: ["dark"],
theme: {
container: {
center: true,
padding: "2rem",
screens: {
"2xl": "1400px"
}
},
extend: {
animation: {
'move-right-left': 'move-right-left 1s ease-in-out infinite',
},
colors: {
// 边框
border: "hsl(var(--border) / <alpha-value>)",
// 输入
input: "hsl(var(--input) / <alpha-value>)",
// 环
ring: "hsl(var(--ring))",
// 背景
background: "hsl(var(--background) / <alpha-value>)",
// 前景
foreground: "hsl(var(--foreground) / <alpha-value>)",
// 主要
primary: {
DEFAULT: "hsl(var(--primary) / <alpha-value>)",
foreground: "hsl(var(--primary-foreground) / <alpha-value>)"
},
// 次要
secondary: {
DEFAULT: "hsl(var(--secondary) / <alpha-value>)",
foreground:
"hsl(var(--secondary-foreground) / <alpha-value>)"
},
// 警告
destructive: {
DEFAULT: "hsl(var(--destructive) / <alpha-value>)",
foreground:
"hsl(var(--destructive-foreground) / <alpha-value>)"
},
// 混色
muted: {
DEFAULT: "hsl(var(--muted) / <alpha-value>)",
foreground: "hsl(var(--muted-foreground) / <alpha-value>)"
},
// 强调
accent: {
DEFAULT: "hsl(var(--accent) / <alpha-value>)",
foreground: "hsl(var(--accent-foreground) / <alpha-value>)"
},
// 弹窗
popover: {
DEFAULT: "hsl(var(--popover) / <alpha-value>)",
foreground: "hsl(var(--popover-foreground) / <alpha-value>)"
},
// 卡片
card: {
DEFAULT: "hsl(var(--card) / <alpha-value>)",
foreground: "hsl(var(--card-foreground) / <alpha-value>)"
},
// 牛油果
// ddy: {
// 200: '#c1dfc3', // bg
// 400: '#4fa74e', // text
// 600: '#027f1b', // dark-text
// 800: '#013912', // dark-bg
// },
ddy: {
100: '#ffedd5',
200: '#fed7aa', // bg
400: '#fb923c', // text
600: '#ea580c', // dark-text
800: '#9a3412', // dark-bg
900: '#431407'
},
},
borderRadius: {
lg: "var(--radius)",
md: "calc(var(--radius) - 2px)",
sm: "calc(var(--radius) - 4px)"
},
fontFamily: {
sans: ["Inter", ...fontFamily.sans]
},
typography: (theme) => ({
DEFAULT: {
css: {
'p code, li code': {
color: theme('colors.primary.foreground'),
backgroundColor: theme('colors.ddy.200'),
padding: '0.125rem 0.25rem',
margin: '0.125rem 0.125rem',
borderRadius: '0.25rem'
},
"code::before": {
content: '""',
},
"code::after": {
content: '""',
},
ul: {
listStyleType: 'none',
},
'ul > li': {
position: 'relative',
},
'ul > li::before': {
content: '"•"',
position: 'absolute',
left: '-0.5rem',
},
},
},
dark: {
css: {
'p code, li code': {
color: theme('colors.primary.foreground'),
backgroundColor: theme('colors.ddy.800'),
padding: '0.125rem 0.25rem',
borderRadius: '0.25rem'
},
}
}
}),
}
},
plugins: [require('@tailwindcss/typography')]
};
export default config;