-
Notifications
You must be signed in to change notification settings - Fork 0
/
tailwind.config.js
56 lines (54 loc) · 1.73 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
const { red } = require('tailwindcss/colors');
const { fontFamily } = require('tailwindcss/defaultTheme');
module.exports = {
content: [
'./src/layouts/**.{vue,html,js}',
'./src/components/**/*.{vue,html,js}',
'./src/pages/**/*.{vue,html,js}',
],
theme: {
extend: {
colors: {
primary: red,
},
gridTemplateColumns: {
filter: 'repeat(auto-fill, minmax(200px, 1fr))',
},
fontFamily: {
...fontFamily,
serif: ['Alegreya', 'serif'],
sans: ['Alegreya Sans', 'sans-serif'],
},
},
container: {
center: true,
padding: {
DEFAULT: '1rem',
sm: '2rem',
md: '3rem',
lg: '4rem',
xl: '5rem',
'2xl': '6rem',
},
},
},
plugins: [
require('@tailwindcss/aspect-ratio'),
require('@tailwindcss/container-queries'),
function ({ addBase, theme }) {
function extractColorVars(colorObj, colorGroup = '') {
return Object.keys(colorObj).reduce((vars, colorKey) => {
const value = colorObj[colorKey];
const newVars =
typeof value === 'string'
? { [`--color${colorGroup}-${colorKey}`]: value }
: extractColorVars(value, `-${colorKey}`);
return { ...vars, ...newVars };
}, {});
}
addBase({
':root': extractColorVars(theme('colors').primary, '-primary'),
});
},
],
};