forked from PrefectHQ/prefect-ui-library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtailwindPlugin.js
47 lines (41 loc) · 1.28 KB
/
tailwindPlugin.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
/* eslint-disable @typescript-eslint/no-require-imports */
/* eslint-disable @typescript-eslint/no-var-requires */
const prefectDesignPlugin = require('@prefecthq/prefect-design/dist/tailwindPlugin.js')
const plugin = require('tailwindcss/plugin')
const states = ['completed', 'failed', 'running', 'pending', 'scheduled', 'cancelled', 'crashed', 'paused']
const stateColors = states.reduce((colors, state) => {
colors[`state-${state}`] = {
50: `var(--state-${state}-50)`,
100: `var(--state-${state}-100)`,
200: `var(--state-${state}-200)`,
300: `var(--state-${state}-300)`,
400: `var(--state-${state}-400)`,
500: `var(--state-${state}-500)`,
600: `var(--state-${state}-600)`,
700: `var(--state-${state}-700)`,
800: `var(--state-${state}-800)`,
900: `var(--state-${state}-900)`,
}
return colors
}, {})
const config = {
content: [
'./index.html',
'./src/**/*.{vue,js,ts,jsx,tsx}',
],
safelist: [
{
pattern: /(bg|text)-state-(completed|failed|running|pending|scheduled|cancelled|crashed|paused)/,
},
],
theme: {
extend: {
colors: {
...stateColors,
},
},
},
plugins: [prefectDesignPlugin],
}
function PrefectUiLibraryPlugins() { /* noop */ }
module.exports = plugin(PrefectUiLibraryPlugins, config)