Compare commits
2 Commits
0f6a67470d
...
d624ac6ab2
Author | SHA1 | Date | |
---|---|---|---|
d624ac6ab2 | |||
409926a97b |
@ -2,7 +2,7 @@ import Image from "next/image";
|
||||
|
||||
export default function Home() {
|
||||
return (
|
||||
<main className="flex flex-col items-center justify-between p-24">
|
||||
<main className="flex flex-col items-center justify-end h-full w-2/4">
|
||||
<h1>Hello world !</h1>
|
||||
</main>
|
||||
);
|
||||
|
@ -1,5 +1,8 @@
|
||||
import type { Config } from "tailwindcss"
|
||||
|
||||
// @ts-ignore
|
||||
import {default as flattenColorPalette} from "tailwindcss/lib/util/flattenColorPalette";
|
||||
|
||||
const config = {
|
||||
darkMode: ["class"],
|
||||
content: [
|
||||
@ -74,7 +77,19 @@ const config = {
|
||||
},
|
||||
},
|
||||
},
|
||||
plugins: [require("tailwindcss-animate")],
|
||||
plugins: [require("tailwindcss-animate"), addVariablesForColors],
|
||||
} satisfies Config
|
||||
|
||||
// This plugin adds each Tailwind color as a global CSS variable, e.g. var(--gray-200).
|
||||
function addVariablesForColors({ addBase, theme }: any) {
|
||||
let allColors = flattenColorPalette(theme("colors"));
|
||||
let newVars = Object.fromEntries(
|
||||
Object.entries(allColors).map(([key, val]) => [`--${key}`, val])
|
||||
);
|
||||
|
||||
addBase({
|
||||
":root": newVars,
|
||||
});
|
||||
}
|
||||
|
||||
export default config
|
Loading…
x
Reference in New Issue
Block a user