-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtailwind.config.js
171 lines (169 loc) · 5.98 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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
/* eslint-disable */
const { toRadixVars } = require("windy-radix-palette/vars");
const radixColors = require("@radix-ui/colors");
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
"./app/**/*.{ts,tsx}",
"./components/**/*.{ts,tsx}",
"./ui/**/*.{ts,tsx}",
"./hooks/**/*.tsx",
"./.storybook/*.html",
"./.storybook/preview.ts",
],
darkMode: "class",
theme: {
extend: {
fontFamily: {
sans: ["var(--font-noto-sans-sc)"],
},
colors: {
bangumi: "#f09199",
primary: toRadixVars("red"),
accent: toRadixVars("cyan"),
neutral: toRadixVars("mauve"),
success: toRadixVars("green"),
error: toRadixVars("tomato"),
info: toRadixVars("blue"),
...radixColors.blackA,
},
// https://github.com/ecklf/tailwindcss-radix/blob/main/demo/tailwind.config.js
boxShadow: {
slider: "0 0 0 5px rgba(0, 0, 0, 0.3)",
},
keyframes: {
// Dropdown menu
"scale-in": {
"0%": { opacity: 0, transform: "scale(0)" },
"100%": { opacity: 1, transform: "scale(1)" },
},
"slide-down": {
"0%": { opacity: 0, transform: "translateY(-10px)" },
"100%": { opacity: 1, transform: "translateY(0)" },
},
"slide-up": {
"0%": { opacity: 0, transform: "translateY(10px)" },
"100%": { opacity: 1, transform: "translateY(0)" },
},
// Tooltip
"slide-up-fade": {
"0%": { opacity: 0, transform: "translateY(2px)" },
"100%": { opacity: 1, transform: "translateY(0)" },
},
"slide-right-fade": {
"0%": { opacity: 0, transform: "translateX(-2px)" },
"100%": { opacity: 1, transform: "translateX(0)" },
},
"slide-down-fade": {
"0%": { opacity: 0, transform: "translateY(-2px)" },
"100%": { opacity: 1, transform: "translateY(0)" },
},
"slide-left-fade": {
"0%": { opacity: 0, transform: "translateX(2px)" },
"100%": { opacity: 1, transform: "translateX(0)" },
},
// Navigation menu
"enter-from-right": {
"0%": { transform: "translateX(200px)", opacity: 0 },
"100%": { transform: "translateX(0)", opacity: 1 },
},
"enter-from-left": {
"0%": { transform: "translateX(-200px)", opacity: 0 },
"100%": { transform: "translateX(0)", opacity: 1 },
},
"exit-to-right": {
"0%": { transform: "translateX(0)", opacity: 1 },
"100%": { transform: "translateX(200px)", opacity: 0 },
},
"exit-to-left": {
"0%": { transform: "translateX(0)", opacity: 1 },
"100%": { transform: "translateX(-200px)", opacity: 0 },
},
"scale-in-content": {
"0%": { transform: "rotateX(-30deg) scale(0.9)", opacity: 0 },
"100%": { transform: "rotateX(0deg) scale(1)", opacity: 1 },
},
"scale-out-content": {
"0%": { transform: "rotateX(0deg) scale(1)", opacity: 1 },
"100%": { transform: "rotateX(-10deg) scale(0.95)", opacity: 0 },
},
"fade-in": {
"0%": { opacity: 0 },
"100%": { opacity: 1 },
},
"fade-out": {
"0%": { opacity: 1 },
"100%": { opacity: 0 },
},
// Toast
"toast-hide": {
"0%": { opacity: 1 },
"100%": { opacity: 0 },
},
"toast-slide-in-right": {
"0%": { transform: `translateX(calc(100% + 1rem))` },
"100%": { transform: "translateX(0)" },
},
"toast-slide-in-bottom": {
"0%": { transform: `translateY(calc(100% + 1rem))` },
"100%": { transform: "translateY(0)" },
},
"toast-swipe-out": {
"0%": { transform: "translateX(var(--radix-toast-swipe-end-x))" },
"100%": {
transform: `translateX(calc(100% + 1rem))`,
},
},
},
animation: {
// Dropdown menu
"scale-in": "scale-in 0.2s ease-in-out",
"slide-down": "slide-down 0.6s cubic-bezier(0.16, 1, 0.3, 1)",
"slide-up": "slide-up 0.6s cubic-bezier(0.16, 1, 0.3, 1)",
// Tooltip
"slide-up-fade": "slide-up-fade 0.4s cubic-bezier(0.16, 1, 0.3, 1)",
"slide-right-fade":
"slide-right-fade 0.4s cubic-bezier(0.16, 1, 0.3, 1)",
"slide-down-fade": "slide-down-fade 0.4s cubic-bezier(0.16, 1, 0.3, 1)",
"slide-left-fade": "slide-left-fade 0.4s cubic-bezier(0.16, 1, 0.3, 1)",
// Navigation menu
"enter-from-right": "enter-from-right 0.25s ease",
"enter-from-left": "enter-from-left 0.25s ease",
"exit-to-right": "exit-to-right 0.25s ease",
"exit-to-left": "exit-to-left 0.25s ease",
"scale-in-content": "scale-in-content 0.2s ease",
"scale-out-content": "scale-out-content 0.2s ease",
"fade-in": "fade-in 0.2s ease",
"fade-out": "fade-out 0.2s ease",
// Toast
"toast-hide": "toast-hide 100ms ease-in forwards",
"toast-slide-in-right":
"toast-slide-in-right 150ms cubic-bezier(0.16, 1, 0.3, 1)",
"toast-slide-in-bottom":
"toast-slide-in-bottom 150ms cubic-bezier(0.16, 1, 0.3, 1)",
"toast-swipe-out": "toast-swipe-out 100ms ease-out forwards",
},
},
},
plugins: [
require("prettier-plugin-tailwindcss"),
require("windy-radix-palette")({
colors: {
red: radixColors.red,
redDark: radixColors.redDark,
cyan: radixColors.cyan,
cyanDark: radixColors.cyanDark,
mauve: radixColors.mauve,
mauveDark: radixColors.mauveDark,
green: radixColors.green,
greenDark: radixColors.greenDark,
tomato: radixColors.tomato,
tomatoDark: radixColors.tomatoDark,
blue: radixColors.blue,
blueDark: radixColors.blueDark,
},
}),
require("tailwindcss-radix")(),
require("tailwindcss-animate"),
],
};