-
Notifications
You must be signed in to change notification settings - Fork 1
/
tailwind.config.js
175 lines (160 loc) · 5.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
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
// const {
// default: flattenColorPalette,
// } = require("tailwindcss/lib/util/flattenColorPalette");
// /** @type {import('tailwindcss').Config} */
// module.exports = {
// content: [
// "./index.html", // from the second config
// "./src/**/*.{js,ts,jsx,tsx}", // from the second config
// "./src/**/*.{ts,tsx}", // from the first config
// ],
// darkMode: "class", // from the first config
// theme: {
// extend: {
// colors: {
// // colors from the second config
// "primary": "#141414",
// "navy": "#172554",
// "specialtext": "#fcd34d",
// },
// animation: {
// // animation from the first config
// aurora: "aurora 60s linear infinite",
// },
// keyframes: {
// // keyframes from the first config
// aurora: {
// from: {
// backgroundPosition: "50% 50%, 50% 50%",
// },
// to: {
// backgroundPosition: "350% 50%, 350% 50%",
// },
// },
// },
// },
// },
// plugins: [
// // add global CSS variables for colors from the first config
// 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,
// });
// }
// import svgToDataUri from "mini-svg-data-uri";
// import { default as flattenColorPalette } from "tailwindcss/lib/util/flattenColorPalette";
// /** @type {import('tailwindcss').Config} */
// export const content = [
// "./index.html", // from the second config
// "./src/**/*.{js,ts,jsx,tsx}", // merged content from both configs
// ];
// export const darkMode = "class";
// export const theme = {
// extend: {
// colors: {
// // colors from the second config
// "primary": "#141414",
// "navy": "#172554",
// "specialtext": "#fcd34d",
// },
// animation: {
// // animation from the first config
// aurora: "aurora 60s linear infinite",
// },
// keyframes: {
// // keyframes from the first config
// aurora: {
// from: {
// backgroundPosition: "50% 50%, 50% 50%",
// },
// to: {
// backgroundPosition: "350% 50%, 350% 50%",
// },
// },
// },
// },
// };
// export const plugins = [
// // add global CSS variables for colors from the first config
// addVariablesForColors,
// function ({ matchUtilities, theme }) {
// matchUtilities({
// "bg-dot-thick": (value) => ({
// backgroundImage: `url("${svgToDataUri(
// `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="16" height="16" fill="none"><circle fill="${value}" id="pattern-circle" cx="10" cy="10" r="2.5"></circle></svg>`
// )}")`,
// }),
// }, { values: flattenColorPalette(theme("backgroundColor")), type: "color" });
// },
// ];
// // 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,
// });
// }
import svgToDataUri from "mini-svg-data-uri";
import { default as flattenColorPalette } from "tailwindcss/lib/util/flattenColorPalette";
import defaultTheme from "tailwindcss/defaultTheme";
import colors from "tailwindcss/colors";
/** @type {import('tailwindcss').Config} */
export const content = [
"./index.html",
"./src/**/*.{js,ts,jsx,tsx}",
];
export const theme = {
extend: {
colors: {
"primary": "#141414",
"navy": "#172554",
"specialtext": "#fcd34d",
...colors,
},
animation: {
aurora: "aurora 60s linear infinite",
scroll: "scroll var(--animation-duration, 40s) var(--animation-direction, forwards) linear infinite",
},
keyframes: {
aurora: {
from: {
backgroundPosition: "50% 50%, 50% 50%",
},
to: {
backgroundPosition: "350% 50%, 350% 50%",
},
},
scroll: {
to: {
transform: "translate(calc(-50% - 0.5rem))",
},
},
},
},
};
export const plugins = [
addVariablesForColors,
function ({ matchUtilities, theme }) {
matchUtilities({
"bg-dot-thick": (value) => ({
backgroundImage: `url("${svgToDataUri(
`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="16" height="16" fill="none"><circle fill="${value}" id="pattern-circle" cx="10" cy="10" r="2.5"></circle></svg>`
)}")`,
}),
}, { values: flattenColorPalette(theme("backgroundColor")), type: "color" });
},
];
function addVariablesForColors({ addBase, theme }) {
let allColors = flattenColorPalette(theme("colors"));
let newVars = Object.fromEntries(Object.entries(allColors).map(([key, val]) => [`--${key}`, val]));
addBase({
":root": newVars,
});
}