-
Notifications
You must be signed in to change notification settings - Fork 283
/
Copy pathtailwind.config.js
53 lines (50 loc) · 1.28 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
const {
default: flattenColorPalette,
} = require("tailwindcss/lib/util/flattenColorPalette");
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
"./src/**/*.{ts,tsx}",
],
darkMode: "class",
theme: {
extend: {
colors: {
border: "hsl(var(--border))",
input: "hsl(var(--input))",
background: "hsl(var(--background))",
foreground: "hsl(var(--foreground))",
},
animation: {
aurora: "aurora 60s linear infinite",
},
keyframes: {
aurora: {
from: {
backgroundPosition: "50% 50%, 50% 50%",
},
to: {
backgroundPosition: "350% 50%, 350% 50%",
},
},
},
},
},
plugins: [addVariablesForColors],
};
// This plugin adds each Tailwind color as a global CSS variable, e.g. var(--gray-200).
function addVariablesForColors({ addBase, theme }) {
let allColors = flattenColorPalette(theme("colors"));
let newVars = Object.fromEntries(
Object.entries(allColors).map(([key, val]) => [`--${key}`, val])
);
addBase({
":root": {
...newVars,
"--border": "214.3 31.8% 91.4%",
"--input": "214.3 31.8% 91.4%",
"--background": "0 0% 100%",
"--foreground": "222.2 84% 4.9%",
},
});
}