-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtailwind.config.js
More file actions
36 lines (32 loc) · 1.07 KB
/
Copy pathtailwind.config.js
File metadata and controls
36 lines (32 loc) · 1.07 KB
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
/** @type {import('tailwindcss').Config} */
const colors = require("./utils/colors");
// Generate a list of all color keys from one of the themes to create the CSS variable mappings in Tailwind. All themes should share the same set of keys.
const colorKeys = Object.keys(colors.themes.default.light);
const tailwindColors = {};
colorKeys.forEach((key) => {
// Tailwind class e.g. bg-brand-primary-base will use CSS var --brand-primary-base
tailwindColors[key] = `var(--${key})`;
});
// Optionally, make primitive colors directly available in Tailwind if needed, e.g., bg-neutral-500
const primitiveTailwindColors = {};
for (const colorName in colors.primitives) {
primitiveTailwindColors[colorName] = colors.primitives[colorName];
}
module.exports = {
darkMode: "class",
content: [
"./app/**/*.{js,jsx,ts,tsx}",
"./components/**/*.{js,jsx,ts,tsx}",
"./App.{js,jsx,ts,tsx}",
],
presets: [require("nativewind/preset")],
theme: {
extend: {
colors: {
...tailwindColors,
...primitiveTailwindColors,
},
},
},
plugins: [],
};