-
Notifications
You must be signed in to change notification settings - Fork 0
/
tailwind.config.ts
163 lines (159 loc) · 5.29 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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
import { nextui } from "@nextui-org/theme";
import plugin from "tailwindcss/plugin";
const {
default: flattenColorPalette,
} = require("tailwindcss/lib/util/flattenColorPalette");
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
"./pages/**/*.{js,ts,jsx,tsx,mdx}",
"./public/**/*.{js,ts,jsx,tsx,mdx}",
"./components/**/*.{js,ts,jsx,tsx,mdx}",
"./app/**/*.{js,ts,jsx,tsx,mdx}",
"./node_modules/@nextui-org/theme/dist/components/[object Object].js",
],
darkMode: ["class", "selector"],
theme: {
extend: {
backgroundImage: {
"conic-gradient":
"conic-gradient(from 0deg, red, yellow, green, blue, purple)",
"conic-gradient-angles": "conic-gradient(var(--four), var(--six))",
"custom-radial":
"radial-gradient(50% 50% at 80% 50%, var(--four) 0%, rgba(0, 0, 0, 0) 100%)",
"custom-radial-s":
"radial-gradient(70% 120% at 100% 50%, var(--four) 0%, rgba(0, 0, 0, 0) 100%)",
"custom-radial-sm":
"radial-gradient(33% 69% at 26% 0%, #5e716a8a 0%, rgba(0, 0, 0, 0) 100%)",
"custom-radial-md":
"radial-gradient(71% 109% at -14% 0%, var(--four) 0%, hsla(0, 0%, 100%, .1) 100%), radial-gradient(59% 138% at 120% -66%, var(--four) 0%, hsla(0, 0%, 100%, .1) 100%)",
"custom-radial-lg":
"radial-gradient(38% 107% at 27% -33%, var(--four) 0%, hsla(0, 0%, 100%, .1) 100%), radial-gradient(32% 104% at 112% 0%, var(--four) 0%, hsla(0, 0%, 100%, .1) 100%)",
"custom-gradient-bgl":
"linear-gradient(90deg, hsla(0, 0%, 100%, 1) 0%, hsla(0, 0%, 10%, 0) 50%, hsla(0, 0%, 100%, 1) 100%)",
"custom-gradient-bgl0":
"linear-gradient(180deg, hsla(0, 0%, 100%, 1)10%, hsla(180, 2%, 57%, 0) 50%, hsla(0, 0%, 100%, 0.5) 64%)",
},
colors: {
primary: "var(--color-primary)",
secondary: "var(--color-secondary)",
third: "var(--color-third)",
four: "var(--color-four)",
five: "var(--color-five)",
six: "var(--color-six)",
seven: "var(--color-seven)",
},
animation: {
shimmer: "shimmer 2s linear infinite",
"scroll-vertical":
"scrollVertical var(--animation-duration) linear infinite",
"meteor-effect": "meteor 5s linear infinite",
"accordion-down": "accordion-down 0.2s ease-out",
"accordion-up": "accordion-up 0.2s ease-out",
aurora: "aurora 60s linear infinite",
scroll:
"scroll var(--animation-duration, 40s) var(--animation-direction, forwards) linear infinite",
},
keyframes: {
shimmer: {
from: {
backgroundPosition: "0 0",
},
to: {
backgroundPosition: "-200% 0",
},
},
scrollVertical: {
"0%": {
transform: "translateY(0)",
},
"100%": {
transform: "translateY(-50%)",
},
},
meteor: {
"0%": {
transform: "rotate(215deg) translateX(0)",
opacity: "1",
},
"70%": {
opacity: "1",
},
"100%": {
transform: "rotate(215deg) translateX(-500px)",
opacity: "0",
},
},
"accordion-down": {
from: {
height: "0",
},
to: {
height: "var(--radix-accordion-content-height)",
},
},
"accordion-up": {
from: {
height: "var(--radix-accordion-content-height)",
},
to: {
height: "0",
},
},
scroll: {
to: {
transform: "translate(calc(-50% - 0.5rem))",
},
},
aurora: {
from: {
backgroundPosition: "50% 50%, 50% 50%",
},
to: {
backgroundPosition: "350% 50%, 350% 50%",
},
},
},
},
},
plugins: [
nextui(),
addVariablesForColors,
require("tailwind-scrollbar"),
require("@tailwindcss/forms"),
plugin(function ({ addBase, theme }) {
addBase({
":root": {
"--color-primary": theme("colors.primary"),
"--color-secondary": theme("colors.secondary"),
"--color-third": theme("colors.third"),
"--color-four": theme("colors.four"),
"--color-five": theme("colors.five"),
"--color-six": theme("colors.six"),
"--color-seven": theme("colors.seven"),
},
"@media (prefers-color-scheme: dark)": {
":root": {
"--color-primary": theme("colors.primary"),
"--color-secondary": theme("colors.secondary"),
"--color-third": theme("colors.third"),
"--color-four": theme("colors.four"),
"--color-five": theme("colors.five"),
"--color-six": theme("colors.six"),
"--color-seven": theme("colors.seven"),
},
},
});
}),
],
};
// This plugin adds each Tailwind color as a global CSS variable, e.g. var(--gray-200).
function addVariablesForColors({ addBase, theme }: any) {
let allColors = flattenColorPalette(theme("colors"));
let newVars = Object.fromEntries(
Object.entries(allColors).map(([key, val]) => [`--${key}`, val])
);
addBase({
":root": newVars,
});
}