-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathtailwind.config.ts
71 lines (68 loc) · 1.76 KB
/
tailwind.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
import type { Config } from "tailwindcss";
import plugin from "tailwindcss/plugin";
import { getColorPalettes } from "./src/styles/theme/antd/css-variables";
export default {
darkMode: "class",
corePlugins: {
preflight: false,
},
content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
theme: {
/**
* @see https://tailwindcss.com/docs/customizing-colors#using-css-variables
*/
colors: {
/**
* 使用 Ant Design 的颜色系统来替代 Tailwind CSS 默认的颜色配置
* 说明:对于亮色和暗色模式,除基础色板外的颜色会自动适配主题,无需额外配置(例如:bg-colorBorderSecondary)
* 但基础色板(如 bg-cyan-100)仍需手动设置暗色模式样式
* @see https://ant.design/docs/spec/colors
*/
...getColorPalettes,
},
/**
* Use ant design breakpoints
* @see https://tailwindcss.com/docs/breakpoints
* @see https://ant.design/components/layout-cn#breakpoint-width
*/
screens: {
"xs": "480px",
"sm": "576px",
"md": "768px",
"lg": "992px",
"xl": "1200px",
"2xl": "1600px",
},
extend: {
keyframes: {
wiggle: {
"0%, 100%": { "transform-origin": "top" },
"15%": { transform: "rotateZ(10deg)" },
"30%": { transform: "rotateZ(-10deg)" },
"45%": { transform: "rotateZ(5deg)" },
"60%": { transform: "rotateZ(-5deg)" },
"75%": { transform: "rotateZ(2deg)" },
},
},
animation: {
wiggle: "wiggle 1s both",
},
},
},
plugins: [
plugin(({ addVariant }) => {
const languages = ["en-US", "zh-CN"];
/**
* 添加 lang 伪类选择器
*
* @example
* ```
* en-US:text-white
* ```
*/
for (const lang of languages) {
addVariant(`${lang}`, `&:lang(${lang})`);
}
}),
],
} satisfies Config;