-
Notifications
You must be signed in to change notification settings - Fork 1
/
tailwind.config.js
85 lines (79 loc) · 2.39 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
const defaultTheme = require("tailwindcss/defaultTheme");
const colorAlgorithm = require("@k-vyn/coloralgorithm");
const colorboxColors = require("./colorbox.json");
// https://colorbox.io/
const generatedColors = colorboxColors.map(({ properties, options }) => {
const output = colorAlgorithm.generate(properties, options);
return output.find((item) => !item.inverted);
});
const colors = generatedColors.reduce((accColor, color) => {
const colorSteps = color.colors.reduce((accStep, step) => {
return {
...accStep,
[step.step]: step.hex,
};
}, {});
return {
...accColor,
[color.name.toLowerCase()]: colorSteps,
};
}, {});
const makeShadow = (name, rgb) => {
let obj = {};
obj[name + "-xs"] = `0 0 0 1px rgba(${rgb}, 0.05)`;
obj[name + "-xs"] = `0 0 0 1px rgba(${rgb}, 0.05)`;
obj[name + "-sm"] = `0 1px 2px 0 rgba(${rgb}, 0.05)`;
obj[name] = `0 1px 3px 0 rgba(${rgb}, 0.1), 0 1px 2px 0 rgba(${rgb}, 0.06)`;
obj[
name + "-md"
] = `0 4px 6px -1px rgba(${rgb}, 0.1), 0 2px 4px -1px rgba(${rgb}, 0.06)`;
obj[
name + "-lg"
] = `0 10px 15px -3px rgba(${rgb}, 0.1), 0 4px 6px -2px rgba(${rgb}, 0.05)`;
obj[
name + "-xl"
] = `0 20px 25px -5px rgba(${rgb}, 0.1), 0 10px 10px -5px rgba(${rgb}, 0.04)`;
obj[name + "-2xl"] = `0 25px 50px -12px rgba(${rgb}, 0.25)`;
obj[name + "-inner"] = `inset 0 2px 4px 0 rgba(${rgb}, 0.06)`;
return obj;
};
module.exports = {
mode: "jit",
important: true,
purge: ["./src/**/*.{js,jsx,ts,tsx,html,template}", "./posts/**/*.mdx"],
darkMode: "class",
theme: {
fontFamily: {
heading: ["freight-display-pro", ...defaultTheme.fontFamily.sans],
sans: ["Charter", ...defaultTheme.fontFamily.sans],
},
colors: {
...colors,
white: "white",
black: "black",
transparent: "transparent",
},
extend: {
gridTemplateRows: {
layout: "auto 1fr auto",
},
lineHeight: {
normal: "1.6",
},
gap: {
"global-xl": defaultTheme.spacing["8"],
"global-lg": defaultTheme.spacing["8"],
"global-md": defaultTheme.spacing["6"],
"global-sm": defaultTheme.spacing["6"],
global: defaultTheme.spacing["2"],
},
spacing: {
paragraph: defaultTheme.spacing["5"],
},
boxShadow: {
...makeShadow("white", "255, 255, 255"),
},
},
},
plugins: [require("tailwindcss-children")],
};