-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
/
Copy pathtailwind.config.js
96 lines (93 loc) · 2.62 KB
/
tailwind.config.js
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
/** @type {import('tailwindcss/plugin')} */
// eslint-disable-next-line import/no-import-module-exports
import plugin from 'tailwindcss/plugin';
const defaultTheme = require('tailwindcss/defaultTheme');
/** @type {import('tailwindcss').Config} */
module.exports = {
darkMode: ['class', '[data-mui-color-scheme="dark"]'],
content: [
'./data/**/*.{js,ts,jsx,tsx,mdx}',
'./pages/**/*.{js,ts,jsx,tsx,mdx}',
'./src/**/*.{js,ts,jsx,tsx,mdx}',
],
theme: {
extend: {
animation: {
appear: 'in-right 200ms',
},
border: {
3: '3px',
},
boxShadow: {
'outline-purple': '0 0 0 4px rgba(192, 132, 252, 0.25)',
'outline-purple-light': '0 0 0 4px rgba(245, 208, 254, 0.25)',
'outline-purple-xs': '0 0 0 1px rgba(192, 132, 252, 0.25)',
'outline-switch': '0 0 1px 3px rgba(168, 85, 247, 0.35)',
},
cursor: {
inherit: 'inherit',
},
fontFamily: {
sans: ['IBM Plex Sans', ...defaultTheme.fontFamily.sans],
},
keyframes: {
'in-right': {
from: { transform: 'translateX(100%)' },
to: { transform: 'translateX(0)' },
},
},
lineHeight: {
5.5: '1.375rem',
},
maxWidth: {
snackbar: '560px',
},
minHeight: {
badge: '22px',
},
minWidth: {
badge: '22px',
listbox: '200px',
snackbar: '300px',
'tabs-list': '400px',
},
},
},
corePlugins: {
// Remove the Tailwind CSS preflight styles so it can use Material UI's preflight instead (CssBaseline).
preflight: false,
},
plugins: [
plugin(({ addVariant }) => {
[
'active',
'checked',
'completed',
'disabled',
'readOnly',
'error',
'expanded',
'focused',
'required',
'selected',
].forEach((state) => {
addVariant(`ui-${state}`, [`&[class~="Mui-${state}"]`, `&[class~="base--${state}"]`]);
addVariant(`ui-not-${state}`, [
`&:not([class~="Mui-${state}"])`,
`&:not([class~="base--${state}"])`,
]);
});
// for focus-visible, use the same selector as headlessui
// https://github.com/tailwindlabs/headlessui/blob/main/packages/%40headlessui-tailwindcss/src/index.ts#LL35C11-L35C11
addVariant(`ui-focus-visible`, [
`&[class~="Mui-focusVisible"]`,
`&[class~="base--focusVisible"]`,
`&:focus-visible`,
]);
addVariant(`ui-not-focus-visible`, [
`&:not([class~="Mui-focusVisible"])`,
`&:not([class~="base--focusVisible"])`,
]);
}),
],
};