-
Notifications
You must be signed in to change notification settings - Fork 6
/
tailwind.config.cjs
72 lines (68 loc) · 1.52 KB
/
tailwind.config.cjs
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
const colors = require("tailwindcss/colors");
/** @type {import('tailwindcss').Config} */
module.exports = {
darkMode: "class",
content: ["./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}"],
theme: {
extend: {
backgroundImage: {
topography: "url('/patterns/topography.svg')",
paper: "url('/patterns/graph-paper.svg')",
},
screens: {
xs: { max: "639px" },
sm: "640px",
md: "768px",
lg: "1025px",
xl: "1280px",
xxl: "1536px",
},
colors: {
primary: colors.indigo,
info: colors.sky,
success: colors.teal,
warning: colors.amber,
danger: colors.rose,
slate: {
1000: "#0a101f",
},
gray: {
1000: "#080c14",
},
zinc: {
1000: "#101012",
},
neutral: {
1000: "#080808",
},
stone: {
1000: "#0f0d0c",
},
},
fontFamily: {
sans: ["Inter", "sans-serif"],
heading: ["Urbanist", "sans-serif"],
},
},
},
plugins: [
require("@tailwindcss/typography"),
require("@tailwindcss/aspect-ratio"),
//Expose Tailwind colors
function ({ addBase, theme }) {
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")),
});
},
],
};