-
Notifications
You must be signed in to change notification settings - Fork 75
/
tailwind.config.js
75 lines (70 loc) · 1.85 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
/** @type {import('tailwindcss').Config} */
const colors = require('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 customShadows = {};
let shadowNames = [];
let textShadows = {};
let textShadowNames = [];
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}`,
]),
]),
]),
];
module.exports = {
content: [
"./src/**/*.{js,ts,jsx,tsx,mdx}",
],
theme: {
colors: {
transparent: 'transparent',
current: 'currentColor',
black: colors.black,
white: colors.white,
gray: colors.neutral,
...customColors
},
extend: {
dropShadow: {
...textShadows,
},
boxShadow: {
...customShadows,
}
}
},
plugins: [],
safelist,
};