-
Notifications
You must be signed in to change notification settings - Fork 0
/
tailwind.config.ts
46 lines (41 loc) · 1.19 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
import type { Config } from 'tailwindcss'
import vidstack from 'vidstack/tailwind.cjs'
import animate from 'tailwindcss-animate'
type TailwindConfig = Config extends { theme: infer T } ? { theme: T } : never
export default {
future: {
hoverOnlyWhenSupported: true,
},
theme: {
extend: {
colors: {
'media-brand': 'rgb(var(--media-brand) / <alpha-value>)',
'media-focus': 'rgb(var(--media-focus) / <alpha-value>)',
},
},
},
plugins: [
animate,
vidstack({
prefix: 'media',
webComponents: true,
}),
customVariants,
],
// Safelisting some classes to avoid content purge
safelist: [
'safelisted',
{
pattern: /i-(lefine)-*/,
},
'i-simple-icons-youtube',
'i-simple-icons-vimeo',
'i-ph-film-reel-fill'
],
} as TailwindConfig
function customVariants({ addVariant, matchVariant }: { addVariant: (name: string, value: string[]) => void; matchVariant: (name: string, value: (value: any) => string) => void}) {
// Strict version of `.group` to help with nesting.
matchVariant('parent-data', (value: any) => `.parent[data-${value}] > &`)
addVariant('hocus', ['&:hover', '&:focus-visible'])
addVariant('group-hocus', ['.group:hover &', '.group:focus-visible &'])
}