-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtailwind.config.js
33 lines (30 loc) · 987 Bytes
/
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
/** @type {import('tailwindcss').Config} */
import animations from '@midudev/tailwind-animations'
import flattenColorPalette from 'tailwindcss/lib/util/flattenColorPalette'
export default {
content: ['./src/**/*.{js,jsx,ts,tsx,astro}'],
darkMode: 'class',
theme: {
extend: {
colors: {
primary: '#4912C5',
'font-light': '#ffffff99',
},
backgroundImage: {
gradient: 'linear-gradient(270deg, #4912C5 0%, #543C8B 127.61%)',
},
borderColor: {
gradient: 'transparent transparent transparent transparent',
},
},
},
plugins: [animations, addVariablesForColors],
}
// This plugin adds each Tailwind color as a global CSS variable, e.g. var(--gray-200).
function addVariablesForColors({ addBase, theme }) {
const allColors = flattenColorPalette(theme('colors'))
const newVars = Object.fromEntries(Object.entries(allColors).map(([key, val]) => [`--${key}`, val]))
addBase({
':root': newVars,
})
}