-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtailwind.config.ts
More file actions
66 lines (61 loc) · 1.63 KB
/
tailwind.config.ts
File metadata and controls
66 lines (61 loc) · 1.63 KB
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
import { redDark, sageDark, tealDark } from '@radix-ui/colors'
import tailwindFluid, {
extract,
type FluidThemeConfig,
fontSize,
screens,
} from 'fluid-tailwind'
import type { Config } from 'tailwindcss'
import tailwindAnimate from 'tailwindcss-animate'
import tailwindRac from 'tailwindcss-react-aria-components'
import { fontFamily } from 'tailwindcss/defaultTheme'
type RadixColorScale = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
const radixColor = (record: Record<`${string}${RadixColorScale}`, string>) =>
Object.entries(record).reduce(
(acc, [k, v]) => {
acc[k.match(/\d+$/)?.[0] as unknown as RadixColorScale] = v
return acc
},
{} as Record<RadixColorScale, string>,
)
const gray = radixColor(sageDark)
const accent = radixColor(tealDark)
const destructive = radixColor(redDark)
const tailwindConfig: Config = {
content: {
files: ['./src/**/*.{js,ts,jsx,tsx,mdx}'],
extract,
},
theme: {
colors: {
transparent: 'transparent',
current: 'currentColor',
inherit: 'inherit',
black: '#000',
white: '#fff',
gray,
accent,
destructive,
},
fontFamily: {
sans: ['var(--font-sans)', ...fontFamily.sans],
mono: ['var(--font-mono)', ...fontFamily.mono],
redacted: ['var(--font-redacted)'],
},
fontSize,
screens: {
lg: screens.lg,
},
fluid: (): FluidThemeConfig => ({
defaultScreens: ['20rem', screens.lg],
}),
extend: {
borderRadius: {
'4xl': '2rem',
'5xl': '2.5rem',
},
},
},
plugins: [tailwindAnimate, tailwindRac, tailwindFluid],
}
export default tailwindConfig