53 lines
1.3 KiB
JavaScript
53 lines
1.3 KiB
JavaScript
|
const colors = require("tailwindcss/colors");
|
||
|
const {
|
||
|
default: flattenColorPalette,
|
||
|
} = require("tailwindcss/lib/util/flattenColorPalette");
|
||
|
|
||
|
/** @type {import('tailwindcss').Config} */
|
||
|
module.exports = {
|
||
|
darkMode: ["class"],
|
||
|
content: [
|
||
|
'./pages/**/*.{js,jsx}',
|
||
|
'./components/**/*.{js,jsx}',
|
||
|
'./app/**/*.{js,jsx}',
|
||
|
'./src/**/*.{js,jsx}',
|
||
|
],
|
||
|
prefix: "",
|
||
|
theme: {
|
||
|
container: {
|
||
|
center: true,
|
||
|
padding: "2rem",
|
||
|
screens: {
|
||
|
"2xl": "1400px",
|
||
|
},
|
||
|
},
|
||
|
extend: {
|
||
|
keyframes: {
|
||
|
"accordion-down": {
|
||
|
from: { height: "0" },
|
||
|
to: { height: "var(--radix-accordion-content-height)" },
|
||
|
},
|
||
|
"accordion-up": {
|
||
|
from: { height: "var(--radix-accordion-content-height)" },
|
||
|
to: { height: "0" },
|
||
|
},
|
||
|
},
|
||
|
animation: {
|
||
|
"accordion-down": "accordion-down 0.2s ease-out",
|
||
|
"accordion-up": "accordion-up 0.2s ease-out",
|
||
|
},
|
||
|
},
|
||
|
},
|
||
|
plugins: [require("tailwindcss-animate"), addVariablesForColors],
|
||
|
}
|
||
|
|
||
|
function addVariablesForColors({ addBase, theme }) {
|
||
|
let allColors = flattenColorPalette(theme("colors"));
|
||
|
let newVars = Object.fromEntries(
|
||
|
Object.entries(allColors).map(([key, val]) => [`--${key}`, val])
|
||
|
);
|
||
|
|
||
|
addBase({
|
||
|
":root": newVars,
|
||
|
});
|
||
|
}
|