-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtailwind.config.js
49 lines (42 loc) · 1.17 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
const tailwindColors = require("tailwindcss/colors");
// This method generates all the dynamic color classes from Tailwind and
// ensures that they are included in the generated CSS.
//
// TODO: This is probably not very performant.
//
const staticColorSet = () => {
const colorSafeList = [];
// Skip these to avoid a load of deprecated warnings when tailwind starts up
const deprecated = [
"lightBlue",
"warmGray",
"trueGray",
"coolGray",
"blueGray",
];
for (const colorName in tailwindColors) {
if (deprecated.includes(colorName)) {
continue;
}
const shades = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900];
const pallette = tailwindColors[colorName];
if (typeof pallette === "object") {
shades.forEach((shade) => {
if (shade in pallette) {
colorSafeList.push(`text-${colorName}-${shade}`);
colorSafeList.push(`bg-${colorName}-${shade}`);
}
});
}
}
return colorSafeList;
};
module.exports = {
safelist: staticColorSet(),
content: [
"./app/**/*.{js,ts,jsx,tsx}",
"./pages/**/*.{js,ts,jsx,tsx}",
"./components/**/*.{js,ts,jsx,tsx}",
],
plugins: [],
};