-
Notifications
You must be signed in to change notification settings - Fork 2
/
tailwind.config.js
141 lines (137 loc) · 3.59 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
const plugin = require("tailwindcss/plugin");
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./**/*.{md,mdx,astro,html,js,jsx,ts,tsx}"],
darkMode: "class",
theme: {
colors: {
// USE THESE SEMANIC COLORS
bg: {
DEFAULT: "var(--bg)",
alt: "var(--bg-alt)",
inv: "var(--bg-inv)",
},
text: {
DEFAULT: "var(--text)",
inv: "var(--text-inv)",
},
links: {
DEFAULT: "var(--links)",
inv: "var(--links-inv)",
active: "var(--links-active)",
"active-inv": "var(--links-active-inv)",
},
headlines: {
DEFAULT: "var(--headlines)",
inv: "var(--headlines-inv)",
},
line: {
DEFAULT: "var(--line)",
dark: "var(--line-dark)",
inv: "var(--line-inv)",
"dark-inv": "var(--line-dark-inv)",
},
shadow: {
primary: {
DEFAULT: "var(--shadow-primary)",
inv: "var(--shadow-primary-inv)",
},
secondary: {
DEFAULT: "var(--shadow-secondary)",
inv: "var(--shadow-secondary-inv)",
},
},
discrete: {
DEFAULT: "var(--gray-light)",
},
// AVOID USING PRIMITIVE COLORS DIRECTLY, RATHER USE SEMANTIC COLORS (SEE ABOVE)
// If you still need to, use the css variable directly (eg. var(--red))
// ...or uncomment the following lines to use with tailwind (avoid this if possible)
// red: {
// DEFAULT: "var(--red)",
// dark: "var(--red-dark)",
// },
// blue: {
// ultralight: "var(--blue-ultralight)",
// light: "var(--blue-light)",
// medium: "var(--blue-medium)",
// DEFAULT: "var(--blue)",
// dark: "var(--blue-dark)",
// darker: "var(--blue-darker)",
// },
// grey: {
// light: "var(--grey-light)",
// },
// white: "var(--white)",
},
fontFamily: {
sans: [
"Clan",
"ui-sans-serif",
"Calibri",
"Segoe UI",
"Roboto",
"Oxygen",
"Ubuntu",
"Cantarell",
"Fira Sans",
"Droid Sans",
"Helvetica Neue",
"Helvetica",
"Arial",
"sans-serif",
],
},
extend: {
transitionTimingFunction: {
"out-extreme": "cubic-bezier(.12,.98,.13,.98)",
},
aria: {
//prettier-ignore
current: "current=\"true\"",
},
lineClamp: {
7: "7",
},
screens: {
xs: "400px",
},
boxShadow: getShadows(),
dropShadow: getShadows(),
},
},
plugins: [
require("@tailwindcss/typography"),
require("@tailwindcss/container-queries"),
require("tailwindcss-touch")(),
plugin(function ({ addUtilities }) {
addUtilities({
".text-balance": {
"text-wrap": "balance",
},
".text-pretty": {
"text-wrap": "pretty",
},
});
}),
],
};
function getShadows() {
return {
none: "0 0 0 transparent",
...getColorVariants("primary"),
...getColorVariants("secondary"),
...getColorVariants("primary-inv"),
...getColorVariants("secondary-inv"),
};
}
function getColorVariants(variant) {
return {
[`${variant}-sm`]: `4px 4px 0 var(--shadow-${variant})`,
[`${variant}`]: `8px 8px 0 var(--shadow-${variant})`,
[`${variant}-md`]: `12px 12px 0 var(--shadow-${variant})`,
[`${variant}-lg`]: `16px 16px 0 var(--shadow-${variant})`,
[`${variant}-xl`]: `18px 18px 0 var(--shadow-${variant})`,
[`${variant}-2xl`]: `24px 24px 0 var(--shadow-${variant})`,
};
}