-
Notifications
You must be signed in to change notification settings - Fork 0
/
tailwind.config.cjs
53 lines (49 loc) · 1.39 KB
/
tailwind.config.cjs
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
const { fontFamily } = require('tailwindcss/defaultTheme')
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ['./src/**/*.{astro,html,js,jsx,md,mdx,ts,tsx}'],
theme: {
extend: {
screens: {
xsm: '480px'
},
zIndex: {
background: '-5',
behind: '-1'
},
fontFamily: {
display: ['var(--font-neue-power)', ...fontFamily.sans],
body: ['var(--font-neue-haas-grotesk)', ...fontFamily.sans],
monospace: [...fontFamily.mono]
},
colors: {
turquoise: '#35FFDB',
sunglow: '#FFC635',
'radical-red': '#FF3559',
'chinese-black': '#00030a',
'dark-gunmetal': '#171D26'
}
}
},
plugins: [
function ({ addBase, theme }) {
function extractColorVars(colorObj, colorGroup = '') {
return Object.keys(colorObj).reduce((vars, colorKey) => {
const value = colorObj[colorKey]
const cssVariable =
colorKey === 'DEFAULT'
? `--color${colorGroup}`
: `--color${colorGroup}-${colorKey}`
const newVars =
typeof value === 'string'
? { [cssVariable]: value }
: extractColorVars(value, `-${colorKey}`)
return { ...vars, ...newVars }
}, {})
}
addBase({
':root': extractColorVars(theme('colors'))
})
}
]
}