-
Notifications
You must be signed in to change notification settings - Fork 0
/
tailwind.config.js
106 lines (93 loc) · 2.48 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
// eslint-disable-next-line @typescript-eslint/no-var-requires
const plugin = require("tailwindcss/plugin");
/** @type {import('tailwindcss').Config} */
module.exports = {
darkMode: ["class"],
content: ["./app/**/*.{ts,tsx}", "./components/**/*.{ts,tsx}"],
theme: {
extend: {
spacing: {
"container-sm": "var(--container-sm)",
"container-md": "var(--container-md)",
"container-inset": "var(--container-inset)",
"container-sm-inner": "var(--container-sm-inner)",
"container-sm-scroll": "var(--container-sm-scroll)",
},
screens: {
"container-sm": "672px",
"container-md": "1024px",
},
colors: {
background: "hsl(var(--background))",
foreground: "hsl(var(--foreground))",
primary: {
DEFAULT: "hsl(var(--primary))",
foreground: "hsl(var(--primary-foreground))",
},
secondary: {
DEFAULT: "hsl(var(--secondary))",
foreground: "hsl(var(--secondary-foreground))",
},
muted: {
DEFAULT: "hsl(var(--muted))",
foreground: "hsl(var(--muted-foreground))",
},
border: "hsl(var(--border))",
},
},
},
plugins: [
require("tailwindcss-animate"),
plugin(({ addUtilities }) => {
addUtilities({ ...createEllipsisUtilities(3), ...createScrollbarUtilities() }, ["responsive"]);
}),
],
};
const createEllipsisUtilities = (count) => {
return objectFrom(
(index) => [
`.ellipsis-${index + 1}`,
{
overflow: "hidden",
"text-overflow": "ellipsis",
"word-break": "break-word",
display: "-webkit-box",
"-webkit-line-clamp": `${index + 1}`,
"-webkit-box-orient": "vertical",
},
],
count,
);
};
const createScrollbarUtilities = () => {
return {
".scrollbar-hide": {
/* IE and Edge */
"-ms-overflow-style": "none",
/* Firefox */
"scrollbar-width": "none",
/* Safari and Chrome */
"&::-webkit-scrollbar": {
display: "none",
},
},
".scrollbar-default": {
/* IE and Edge */
"-ms-overflow-style": "auto",
/* Firefox */
"scrollbar-width": "auto",
/* Safari and Chrome */
"&::-webkit-scrollbar": {
display: "block",
},
},
};
};
const objectFrom = (entry, count) => {
const object = {};
for (let i = 0; i < count; i++) {
const [key, value] = entry(i);
object[key] = value;
}
return object;
};