This repository has been archived by the owner on Oct 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tokens.config.mjs
65 lines (63 loc) · 1.64 KB
/
tokens.config.mjs
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import pluginCSS from "@cobalt-ui/plugin-css";
import pluginJS from "@cobalt-ui/plugin-js";
import pluginTailwind from "@cobalt-ui/plugin-tailwind";
const colorTokens = Object.fromEntries(
["blue", "green", "red", "yellow", "purple"].map((color) => [
color,
{
50: `color.base.${color}.50`,
100: `color.base.${color}.100`,
200: `color.base.${color}.200`,
},
])
);
/** @type {import('@cobalt-ui/core').Config} */
export default {
tokens: "./tokens.json",
outDir: "./tokens/",
plugins: [
pluginCSS({
utility: {
bg: ["color.base.*"],
},
}),
pluginJS(/* options */),
pluginTailwind({
/** (optional) the path to the Tailwind preset */
output: "./tailwind-tokens.js",
/** (optional) module format to use (to match your Tailwind config) */
outputFormat: "esm" | "cjs",
tailwind: {
theme: {
/** @see https://tailwindcss.com/docs/configuration#theme */
colors: {
...colorTokens,
white: {
50: "color.base.white.50",
},
gray: {
50: "color.base.gray.50",
},
},
fontFamily: {
mono: "fontStack.mono",
},
spacing: {
1: "space.4",
2: "space.8",
3: "space.12",
4: "space.16",
5: "space.20",
6: "space.24",
},
extend: {
fontFamily: {
sansSerifPrimary: "fontStack.sansSerifPrimary",
sansSerifDisplay: "fontStack.sansSerifDisplay",
},
},
},
},
}),
],
};