-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtailwind.config.ts
82 lines (80 loc) · 2.47 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
import {
amber,
amberDark,
blue,
blueDark,
green,
greenDark,
red,
redDark,
sage,
sageDark,
teal,
tealDark,
} from '@radix-ui/colors';
import type { Config } from 'tailwindcss';
import twAnimatePlugin from 'tailwindcss-animate';
function convertRadixColorsToTailwind(colors: Record<string, string>, prefix?: string) {
return Object.entries(colors).reduce(
(acc, [key, value]) => {
acc[prefix ? `${prefix}-${key}` : key] = value;
return acc;
},
{} as Record<string, string>,
);
}
const config: Config = {
content: ['./components/**/*.{js,ts,jsx,tsx,mdx}', './app/**/*.{js,ts,jsx,tsx,mdx}'],
darkMode: 'class',
theme: {
colors: {
...convertRadixColorsToTailwind(amber),
...convertRadixColorsToTailwind(amberDark, 'dark'),
...convertRadixColorsToTailwind(blue),
...convertRadixColorsToTailwind(blueDark, 'dark'),
...convertRadixColorsToTailwind(green),
...convertRadixColorsToTailwind(greenDark, 'dark'),
...convertRadixColorsToTailwind(red),
...convertRadixColorsToTailwind(redDark, 'dark'),
...convertRadixColorsToTailwind(sage),
...convertRadixColorsToTailwind(sageDark, 'dark'),
...convertRadixColorsToTailwind(teal),
...convertRadixColorsToTailwind(tealDark, 'dark'),
},
container: {
center: true,
padding: '2rem',
},
keyframes: {
'collapse-down': {
'0%': { height: '0' },
'100%': { height: 'var(--radix-collapsible-content-height)' },
},
'collapse-up': {
'0%': { height: 'var(--radix-collapsible-content-height)' },
'100%': { height: '0' },
},
},
animation: {
'collapse-down': 'collapse-down 300ms ease-out',
'collapse-up': 'collapse-up 300ms ease-out',
},
extend: {
backgroundImage({ theme }) {
return {
brushed: `
repeating-linear-gradient(80deg, hsla(0,0%,100%,0) 0%, hsla(0,0%,100%,0) 6%, hsla(0,0%,100%, .1) 7.5%),
repeating-linear-gradient(80deg, hsla(0,0%, 0%,0) 0%, hsla(0,0%, 0%,0) 4%, hsla(0,0%, 0%,.03) 4.5%),
repeating-linear-gradient(80deg, hsla(0,0%,100%,0) 0%, hsla(0,0%,100%,0) 1.2%, hsla(0,0%,100%,.15) 2.2%),
linear-gradient(180deg,
${theme('colors.teal4')} 0%,
${theme('colors.teal2')} 67%,
${theme('colors.teal4')} 73%,
${theme('colors.teal5')} 100%);`,
};
},
},
},
plugins: [twAnimatePlugin],
};
export default config;