-
Notifications
You must be signed in to change notification settings - Fork 0
/
tailwind.config.ts
93 lines (90 loc) · 2.21 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
import { defineConfig } from 'vite-plugin-windicss';
import plugin from 'windicss/plugin';
//* SEE: https://windicss.org/utilities/
export default defineConfig({
darkMode: 'class',
extract: {
include: [
'./**/*.html',
'./src/**/*.{js,ts,jsx,tsx}',
'./src/**/*.{css,scss,pcss}',
'./**/*.svg',
],
},
theme: {
extend: {},
},
plugins: [
plugin(({ addUtilities, addDynamic, variants }) => {
const containUtilities = {
'.contain-none': {
contain: 'none',
},
'.contain-strict': {
contain: 'strict',
},
'.contain-content': {
contain: 'content',
},
'.contain-size': {
contain: 'size',
},
'.contain-layout': {
contain: 'layout',
},
'.contain-style': {
contain: 'style',
},
'.contain-paint': {
contain: 'paint',
},
'.contain-full': {
contain: 'size layout paint style',
},
'.content-visibility-visible': {
'content-visibility': 'visible',
},
'.content-visibility-hidden': {
'content-visibility': 'hidden',
},
'.content-visibility-auto': {
'content-visibility': 'auto',
},
};
addUtilities(containUtilities);
// FIXME: I have no clue what I'm doing here
/*addDynamic(
'contain',
({ Utility, Style }) => {
return Utility.handler
.handleStatic(Style('contain'))
.handleString((val) => {
// Replace underscores and dashes in val with spaces
val = val.replace(/[_-]/g, ' ').trim();
if (
!/^(?:(?:paint|style|layout|size)\s){1,4}|content|strict|none$/.test(
val,
)
) {
throw new Error(
`Invalid value for 'contain' property: '${val}'\n\
See MDN Docs https://developer.mozilla.org/en-US/docs/Web/CSS/contain#values`,
);
}
return val;
})
.createProperty('contain');
},
variants('contain'),
);*/
}),
require('windicss/plugin/filters'),
require('windicss/plugin/forms'),
require('windicss/plugin/aspect-ratio'),
require('windicss/plugin/line-clamp'),
require('windicss/plugin/typography'),
require('@windicss/plugin-scrollbar'),
require('@windicss/plugin-interaction-variants'),
require('@windicss/plugin-question-mark'),
],
});