-
Notifications
You must be signed in to change notification settings - Fork 0
/
tailwind.config.js
159 lines (154 loc) · 4.5 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
//只是编辑器提供提示的文件
const plugin = require("tailwindcss/plugin");
module.exports = {
content: ["./index.html", "./src/**/*.{vue,js,ts,jsx,tsx}"],
safelist: [],
theme: {
extend: {
spacing: { full: "100%" },
colors: {
"tw-primary": "var(--primary)",
"tw-secondary": "var(--secondary)",
"tw-accent": "var(--accent)",
"tw-dark": "var(--dark)",
"tw-positive": "var(--positive)",
"tw-negative": "var(--negative)",
"tw-info": "var(--info)",
"tw-warning": "var(--warning)",
},
},
},
plugins: [
plugin(function ({ addUtilities, matchUtilities, theme }) {
const newUtilities = {
".center": {
display: "flex",
"justify-content": "center",
"align-items": "center",
},
".between": {
display: "flex",
"justify-content": "space-between",
"align-items": "center",
},
".around": {
display: "flex",
"justify-content": "space-around",
"align-items": "center",
},
".absolute-x-center": {
position: "absolute",
left: "50%",
transform: "translateX(-50%)",
},
".absolute-y-center": {
position: "absolute",
top: "50%",
transform: "translateY(-50%)",
},
".flex-start ": {
display: "flex",
"justify-content": "flex-start",
"align-items": "flex-start",
},
".flex-end ": {
display: "flex",
"justify-content": "flex-end",
"align-items": "flex-end",
},
".scroll-y-hidden": {
"overflow-x": "hidden",
"overflow-y": "auto",
},
".scroll-y-hidden::-webkit-scrollbar ": {
height: "0px",
width: "0px",
},
".scroll-xy": {
overflow: "auto",
},
".scroll-xy::-webkit-scrollbar ": {
height: "8px",
width: "8px",
},
".scroll-xy::-webkit-scrollbar-thumb ": {
background: "rgba(0, 0, 0, 0.2)",
},
".scroll-x-hidden": {
overflow: "auto",
},
/* 滚动条整体部分,可以设置宽度等 */
".scroll-x-hidden::-webkit-scrollbar ": {
height: "0",
width: "8px",
},
/* 滚动的滑块 */
".scroll-x-hidden::-webkit-scrollbar-thumb ": {
background: "rgba(0, 0, 0, 0.2)",
},
".scroll-x ": {
"overflow-x": "auto",
"overflow-y": "hidden",
},
".scroll-bar-none::-webkit-scrollbar": {
width: "0px!important",
height: "0px!important",
},
".scroll-scrollbar-width-4px::-webkit-scrollbar": {
width: "4px!important",
height: "4px!important",
},
".scroll-scrollbar-width-8px::-webkit-scrollbar": {
width: "8px!important",
height: "8px!important",
},
".scroll-scrollbar-width::-webkit-scrollbar": {
width: "10px!important",
height: "10px!important",
},
/* 滚动条整体部分,可以设置宽度等 */
".scroll-x::-webkit-scrollbar": {
height: "8px",
},
/* 滚动的滑块 */
".scroll-x::-webkit-scrollbar-thumb ": {
background: "rgba(0, 0, 0, 0.2)",
},
".scroll-y ": {
"overflow-x": "hidden",
"overflow-y": "auto",
},
/* 滚动条整体部分,可以设置宽度等 */
".scroll-y::-webkit-scrollbar ": {
width: "8px",
},
/* 滚动的滑块 */
".scroll-y::-webkit-scrollbar-thumb ": {
width: "10px",
background: "rgba(0, 0, 0, 0.2)",
},
".clearfix::after ": {
content: "",
display: "block",
clear: "both",
},
".capitalize": {
"text-transform": "capitalize",
},
// 优化css渲染速度
".content-visibility": {
"content-visibility": "auto",
},
};
addUtilities(newUtilities, ["responsive", "hover"]);
matchUtilities(
{
wh: (value) => ({ width: value, height: value }),
"grid-auto-w": (value) => ({ "grid-template-columns": `repeat(auto-fill, ${value})` }),
"grid-auto-h": (value) => ({ "grid-template-rows": `repeat(auto-fill, ${value})` }),
},
{ values: theme("spacing") }
);
}),
],
};