forked from gmx-io/gmx-interface
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tailwind.config.js
143 lines (134 loc) · 3.66 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
/* eslint-disable */
const range = require("lodash/range");
const fromPairs = require("lodash/fromPairs");
const merge = require("lodash/merge");
const defaultConfig = require("tailwindcss/defaultConfig");
const colors = {
blue: {
300: "#7885ff",
400: "#4d5ffa",
500: "#3d51ff",
600: "#2d42fc",
700: "#2e3dcd",
},
"cold-blue": {
500: "#3a3f79",
700: "#3a3f798f",
900: "#1e203e",
},
"pale-blue": {
100: "rgba(180,187,255, 0.1)",
600: "rgba(180,187,255, 0.6)",
},
slate: {
100: "#a0a3c4",
500: "#3e4361",
600: "#373c58",
700: "#23263b",
800: "#16182e",
900: "#101124",
950: "#08091b",
},
gray: {
50: "rgba(255, 255, 255, 0.95)",
100: "rgba(255, 255, 255, 0.9)",
200: "rgba(255, 255, 255, 0.8)",
300: "rgba(255, 255, 255, 0.7)",
400: "rgba(255, 255, 255, 0.6)",
500: "rgba(255, 255, 255, 0.5)",
600: "rgba(255, 255, 255, 0.4)",
700: "rgba(255, 255, 255, 0.3)",
800: "rgba(255, 255, 255, 0.2)",
900: "rgba(255, 255, 255, 0.1)",
950: "rgba(255, 255, 255, 0.05)",
},
yellow: {
300: "#ffe166",
500: "#f3b50c",
},
red: {
400: "#ff637a",
500: "#ff506a",
},
green: {
300: "#56dba8",
500: "#0ecc83",
},
white: "#ffffff",
black: "#000000",
};
/**
* @type {import('tailwindcss/types/config').PluginCreator}
*/
function injectColorsPlugin({ addBase, theme }) {
function extractColorVars(colorObj, colorGroup = "") {
return Object.keys(colorObj).reduce((vars, colorKey) => {
const value = colorObj[colorKey];
const visualColorKey = colorKey === "DEFAULT" ? "" : `-${colorKey}`;
const newVars =
typeof value === "string"
? { [`--color${colorGroup}${visualColorKey}`]: value }
: extractColorVars(value, `-${colorKey}`);
return { ...vars, ...newVars };
}, {});
}
addBase({
":root": extractColorVars(theme("colors")),
});
}
/**
* @type {import('tailwindcss/types/config').PluginCreator}
*/
function customUtilsPlugin({ addUtilities, theme }) {
addUtilities({
".scrollbar-hide": {
"scrollbar-width": "none",
"-ms-overflow-style": "none",
"&::-webkit-scrollbar": {
display: "none",
},
},
});
}
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./index.html", "./src/**/*.{js,jsx,ts,tsx}"],
theme: {
// @see https://tailwindcss.com/docs/customizing-spacing
spacing: fromPairs(range(0, 96 + 1).map((spacing) => [spacing, `${spacing}px`])),
borderRadius: merge(fromPairs(range(0, 96 + 1).map((borderRadius) => [borderRadius, `${borderRadius}px`])), {
full: "9999px",
}),
fontSize: {
12: "1.2rem",
14: "1.4rem",
15: "1.5rem",
16: "1.6rem",
24: "2.4rem",
34: "3.4rem",
},
lineHeight: {
1: "1",
2: "2",
// Normal is browser dependent. See https://developer.mozilla.org/en-US/docs/Web/CSS/line-height#normal
base: "normal",
},
// @see https://tailwindcss.com/docs/customizing-colors
colors: colors,
textDecorationColor: colors,
placeholderColor: {
...colors,
gray: "rgb(117, 117, 117)",
},
// @see https://tailwindcss.com/blog/tailwindcss-v3-2#max-width-and-dynamic-breakpoints
// "these features will only be available if your project uses a simple screens configuration."
// So we just copy the default screens config
screens: defaultConfig.theme.screens,
extend: {
gridTemplateColumns: fromPairs(
range(200, 501, 50).map((space) => [`auto-fill-${space}`, `repeat(auto-fill, minmax(${space}px, 1fr))`])
),
},
},
plugins: [injectColorsPlugin, customUtilsPlugin],
};