-
Notifications
You must be signed in to change notification settings - Fork 6
/
tailwind.config.ts
61 lines (58 loc) · 1.5 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
import process from 'node:process';
import { typographyClasses } from './src/consts/typography';
import themePlugin from './src/theme';
import {
baseColors,
baseColorsIntensities,
contextColors,
} from './src/consts/colors';
import type { Config } from 'tailwindcss';
const isDevelopment = process.env.NODE_ENV === 'development' || process.env.STORYBOOK;
const safeListedColorVariants = [
'important',
'hover',
'disabled',
'active',
'focus',
];
export default {
mode: 'jit',
darkMode: 'class',
content: [
'./src/**/*.vue',
...(!isDevelopment
? []
: ['./src/stories/themes/*.mdx', './src/**/*.stories.ts']),
],
safelist: [
// Shadows
{
// eslint-disable-next-line regexp/no-dupe-disjunctions
pattern: /shadow-(?:[1-9]|1\d|2[0-4])/,
},
...(isDevelopment
? [
// Typography
...typographyClasses.map(item => item.className),
// Colors
{
pattern: new RegExp(
`(bg|text|border)-rui-(${baseColors.join(
'|',
)})(-(${baseColorsIntensities.join('|')}))?`,
),
variants: safeListedColorVariants,
},
{
pattern: new RegExp(
`(bg|text|border)-rui(-(light|dark))?-(${contextColors.join(
'|',
)})(-(darker|lighter|tint|shade))?`,
),
variants: safeListedColorVariants,
},
]
: []),
],
plugins: [themePlugin],
} satisfies Config;