-
Notifications
You must be signed in to change notification settings - Fork 1
/
tailwind.config.ts
95 lines (90 loc) · 2.16 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
import aspectRatioPlugin from '@tailwindcss/aspect-ratio';
import typographyPlugin from '@tailwindcss/typography';
import { shadcnPlugin } from './utils/shadcnPlugin';
import headlessui from '@headlessui/tailwindcss';
import animatePlugin from 'tailwindcss-animate';
import formsPlugin from '@tailwindcss/forms';
import { type Config } from 'tailwindcss';
import colors from 'tailwindcss/colors';
const shades = ['50', '100', '200', '300', '400', '500', '600', '700', '800', '900', '950'];
const colorList = [
'gray',
'green',
'cyan',
'amber',
'violet',
'blue',
'rose',
'pink',
'teal',
'red',
];
const uiElements = [
'bg',
'selection:bg',
'border',
'text',
'hover:bg',
'hover:border',
'hover:text',
'ring',
'focus:ring',
];
const customColors = {
cyan: colors.cyan,
green: colors.green,
amber: colors.amber,
violet: colors.violet,
blue: colors.blue,
rose: colors.rose,
pink: colors.pink,
teal: colors.teal,
red: colors.red,
};
let shadowNames = [];
let customShadows: Record<string, string> = {};
let textShadows: Record<string, string> = {};
let textShadowNames: Array<string> = [];
for (const [name, color] of Object.entries(customColors)) {
customShadows[`${name}`] = `0px 0px 10px ${color['500']}`;
customShadows[`lg-${name}`] = `0px 0px 20px ${color['600']}`;
textShadows[`${name}`] = `0px 0px 4px ${color['700']}`;
textShadowNames.push(`drop-shadow-${name}`);
shadowNames.push(`shadow-${name}`);
shadowNames.push(`shadow-lg-${name}`);
shadowNames.push(`hover:shadow-${name}`);
}
const safelist = [
'bg-black',
'bg-white',
'transparent',
'object-cover',
'object-contain',
...shadowNames,
...textShadowNames,
...shades.flatMap((shade) => [
...colorList.flatMap((color) => [
...uiElements.flatMap((element) => [`${element}-${color}-${shade}`]),
]),
]),
];
export default {
content: ['./{app,components}/**/*.{ts,tsx}'],
extend: {
dropShadow: {
...textShadows,
},
boxShadow: {
...customShadows,
},
},
safelist,
plugins: [
headlessui,
animatePlugin,
aspectRatioPlugin,
typographyPlugin,
formsPlugin,
shadcnPlugin,
],
} satisfies Config;