forked from HugoRCD/canvas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tailwind.config.ts
108 lines (102 loc) · 2.67 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
import type { Config } from 'tailwindcss'
import plugin from 'tailwindcss/plugin'
import flattenColorPalette from 'tailwindcss/lib/util/flattenColorPalette'
import svgToDataUri from 'mini-svg-data-uri'
function withOpacity(variableName: string) {
// @ts-expect-error doesn't matter
return ({ opacityValue }) => {
if (opacityValue !== undefined) {
return `rgba(var(${variableName}), ${opacityValue})`
}
return `rgb(var(${variableName}))`
}
}
module.exports = {
content: [
'./components/**/*.{js,vue,ts}',
'./layouts/**/*.vue',
'./pages/**/*.vue',
'./plugins/**/*.{js,ts}',
'./nuxt.config.{js,ts}',
'./app.vue',
'./error.vue',
],
theme: {
extend: {
colors: {
'main': 'var(--bg-main)',
'main-opacity': withOpacity('--bg-main-opacity'),
'secondary': 'var(--bg-secondary)',
'muted': 'var(--font-muted)',
'placeholder': 'var(--font-placeholder)',
},
textColor: {
main: 'var(--font-primary)',
muted: 'var(--font-muted)',
placeholder: 'var(--font-placeholder)',
inverted: 'var(--font-inverted)',
},
borderColor: {
'primary': 'var(--border-primary)',
'primary-hover': 'var(--border-primary-hover)',
'muted': 'var(--border-muted)',
'transparent': 'transparent',
},
borderWidth: {
sm: '1px',
md: '2px',
},
animation: {
marquee: 'marquee 30s linear infinite',
},
keyframes: {
marquee: {
to: { transform: 'translateX(-50%)' },
},
},
textShadow: {
sm: 'rgba(255, 255, 255, 0.35) 1px 1px 12px',
},
fontFamily: {
newsreader: ['Newsreader', 'serif'],
geist: ['Geist', 'sans-serif'],
},
},
},
plugins: [
plugin(({ matchUtilities, theme }) => {
matchUtilities(
{
'text-shadow': value => ({
textShadow: value,
}),
},
{ values: theme('textShadow') },
)
matchUtilities(
{
'bg-grid': value => ({
backgroundImage: `url("${svgToDataUri(
`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" stroke="${value}" fill="none"><path d="M64 0H0V64"/></svg>`,
)}")`,
}),
},
{
values: flattenColorPalette(theme('backgroundColor')),
type: ['color'],
},
)
matchUtilities(
{
'bg-grid': value => ({
backgroundSize: value,
}),
},
{
values: theme('spacing'),
type: ['number', 'length', 'any'],
},
)
}),
],
} satisfies Config