-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtailwind.config.js
More file actions
33 lines (30 loc) · 882 Bytes
/
tailwind.config.js
File metadata and controls
33 lines (30 loc) · 882 Bytes
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
const { themeColors } = require("./theme.config");
const plugin = require("tailwindcss/plugin");
const tailwindColors = Object.fromEntries(
Object.entries(themeColors).map(([name, swatch]) => [
name,
{
DEFAULT: `var(--color-${name})`,
light: swatch.light,
dark: swatch.dark,
},
]),
);
/** @type {import('tailwindcss').Config} */
module.exports = {
darkMode: "class",
// Scan all component and app files for Tailwind classes
content: ["./app/**/*.{js,ts,tsx}", "./components/**/*.{js,ts,tsx}", "./lib/**/*.{js,ts,tsx}", "./hooks/**/*.{js,ts,tsx}"],
presets: [require("nativewind/preset")],
theme: {
extend: {
colors: tailwindColors,
},
},
plugins: [
plugin(({ addVariant }) => {
addVariant("light", ':root:not([data-theme="dark"]) &');
addVariant("dark", ':root[data-theme="dark"] &');
}),
],
};