-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathtailwind.config.ts
146 lines (144 loc) · 4.58 KB
/
tailwind.config.ts
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
144
145
146
import defaultTheme from "tailwindcss/defaultTheme";
import flattenColorPalette from "tailwindcss/lib/util/flattenColorPalette";
import svgToDataUri from "mini-svg-data-uri";
import plugin from "tailwindcss/plugin";
/** @type {import('tailwindcss').Config} */
export default {
content: ["./app/**/*.{ts,tsx,svg}", "./content/**/*.{md,mdx}"],
darkMode: "class",
theme: {
extend: {
gridTemplateRows: {
layout: "auto 1fr auto",
headerBody: "auto 1fr",
},
gridTemplateColumns: {
sidebar: "minmax(240px, 19%) 1fr",
},
screens: {
xs: "480px",
"2xl": "1440px",
"3xl": "1920px",
"4xl": "2560px",
},
fontFamily: {
sans: ["Inter V", ...defaultTheme.fontFamily.sans],
display: ["Circular", ...defaultTheme.fontFamily.sans],
mono: ["Source Code Pro Variable", ...defaultTheme.fontFamily.mono],
},
maxWidth: {
"8xl": "88rem",
"9xl": "96rem",
"10xl": "104rem",
"11xl": "112rem",
"12xl": "120rem",
},
animation: {
enter: "enter .2s ease-out",
leave: "leave .15s ease-in forwards",
fadeInScale: "fadeInScale 1s ease-out forwards",
fadeInScaleFloat:
"fadeInScaleFloat 1s ease-out forwards, float 3s ease-in-out infinite",
fadeIn: "fadeIn 1s ease-out forwards",
slideUpFade: "slideUpFade 1s ease-out forwards",
},
animationDelay: {
1000: "1000ms",
1500: "1500ms",
},
keyframes: {
enter: {
"0%": {
opacity: "0",
transform: "scale(.9)",
},
"100%": {
opacity: "1",
transform: "scale(1)",
},
},
leave: {
"0%": {
opacity: "1",
transform: "scale(1)",
},
"100%": {
opacity: "0",
transform: "scale(.9)",
},
},
fadeInScale: {
"0%": { opacity: "0", transform: "scale(0.98)" },
"100%": { opacity: "1", transform: "scale(1)" },
},
fadeInScaleFloat: {
"0%": { opacity: "0", transform: "scale(0.98) translateY(10px)" },
"100%": { opacity: "1", transform: "scale(1) translateY(0)" },
},
float: {
"0%, 100%": { transform: "translateY(0)" },
"50%": { transform: "translateY(-10px)" },
},
fadeIn: {
"0%": { opacity: "0", transform: "translateY(10px)" },
"70%": { opacity: "0.8", transform: "translateY(1px)" },
"100%": { opacity: "1", transform: "translateY(0)" },
},
slideUpFade: {
"0%": { opacity: "0", transform: "translateY(20px)" },
"100%": { opacity: "1", transform: "translateY(0)" },
},
},
},
},
plugins: [
require("@tailwindcss/forms"),
require("@tailwindcss/typography"),
require("@headlessui/tailwindcss"),
plugin(function ({ addVariant }) {
addVariant("disabled-within", `&:has(input:is(:disabled),button:is(:disabled))`);
}),
plugin(function ({ addVariant }) {
addVariant("invalid-within", `&:has(input:is(:invalid))`);
}),
function ({ matchUtilities, theme }) {
matchUtilities(
{
"bg-grid-sm": value => ({
backgroundImage: `url("${svgToDataUri(
`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="${value}"><path d="M0 .5H23.5V24"/></svg>`,
)}")`,
}),
},
{ values: flattenColorPalette(theme("backgroundColor")), type: "color" },
);
},
function ({ matchUtilities, theme }) {
matchUtilities(
{
"bg-grid": value => ({
backgroundImage: `url("${svgToDataUri(
`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="32" height="32" fill="none" stroke="${value}"><path d="M0 .5H31.5V32"/></svg>`,
)}")`,
}),
},
{ values: flattenColorPalette(theme("backgroundColor")), type: "color" },
);
},
function ({ matchUtilities, theme }) {
matchUtilities(
{
"bg-grid-lg": value => ({
backgroundImage: `url("${svgToDataUri(
`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128" width="128" height="128" fill="none" stroke="${value}"><path d="M0 .5H127.5V127"/></svg>`,
)}")`,
}),
},
{
values: flattenColorPalette(theme("backgroundColor")),
type: "color",
},
);
},
],
};