-
Notifications
You must be signed in to change notification settings - Fork 17
/
tailwind.config.js
58 lines (54 loc) · 1.38 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
const colors = require("tailwindcss/colors");
module.exports = {
content: ["./src/**/*.{js,ts,jsx,tsx,mdx}"],
theme: {
fontFamily: {
sans: ["var(--font-montserrat)", "sans-serif"],
mono: ["var(--font-space-mono)", "monospace"],
roboto: ["var(--font-roboto)", "sans-serif"],
},
colors: {
white: colors.white,
black: colors.black,
transparent: colors.transparent,
red: {
500: "#CC3333",
},
green: {
500: "#008800",
},
blue: {
200: "#A7BDFF",
300: "#85A4FF",
400: "#7879F1",
500: "#4B11F1",
},
gray: {
200: "#EEEEEE",
300: "#C8CCD0",
500: "#75715E",
700: "#333333",
800: "#2C2C2C",
900: "#0E0E2C",
},
},
},
plugins: [
function ({ addBase, theme }) {
// Expose colors as css variables
function extractColorVars(colorObj, colorGroup = "") {
return Object.keys(colorObj).reduce((vars, colorKey) => {
const value = colorObj[colorKey];
const newVars =
typeof value === "string"
? { [`--color${colorGroup}-${colorKey}`]: value }
: extractColorVars(value, `-${colorKey}`);
return { ...vars, ...newVars };
}, {});
}
addBase({
":root": extractColorVars(theme("colors")),
});
},
],
};