-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtailwind.config.js
48 lines (44 loc) · 1.19 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
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ['./src/**/*.{html,ts}'],
theme: {
extend: {
colors: {
sekret: {
50: '#fdf6fb',
100: '#fbecf8',
200: '#f7d7f1',
300: '#efb8e2',
400: '#e58dd0',
500: '#d560b8',
600: '#b33f94',
700: '#98337b',
800: '#7d2b65',
900: '#672853',
950: '#430f32',
},
},
},
},
plugins: [
function ({ addBase, theme }) {
const enabledColors = new Set(['-rose', '-sekret']);
function extractColorVars(colorObj, colorGroup = '') {
return Object.keys(colorObj).reduce((vars, colorKey) => {
const value = colorObj[colorKey];
if (typeof value === 'string' && !enabledColors.has(colorGroup)) {
return vars;
}
const newVars =
typeof value === 'string'
? { [`--color${colorGroup}-${colorKey}`]: value }
: extractColorVars(value, `-${colorKey}`);
return { ...vars, ...newVars };
}, {});
}
addBase({
':root': extractColorVars(theme('colors')),
});
},
],
};