Skip to content

Commit ec4e7ae

Browse files
committed
fix: add flattened vars json
1 parent d9f3c37 commit ec4e7ae

File tree

3 files changed

+142
-1
lines changed

3 files changed

+142
-1
lines changed

system/config.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,29 @@ module.exports = {
6363
},
6464
],
6565
},
66+
67+
/**
68+
* can be used via postcss-simple-variables plugin, in order to not have to import the css itself
69+
* ```
70+
* const tokens = require('adslot-ui/system/internal/variables.json');
71+
*
72+
* require('postcss-simple-vars')({
73+
variables: tokens
74+
})
75+
* ```
76+
*/
77+
postcssVariablesJSON: {
78+
buildPath: `internal/`,
79+
transformGroup: 'web',
80+
files: [
81+
{
82+
destination: `variables.json`,
83+
format: 'json/flat',
84+
options: {
85+
outputReferences: false,
86+
},
87+
},
88+
],
89+
},
6690
},
6791
};

system/internal/variables.json

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
{
2+
"border-radius-base": "2px",
3+
"border-radius-large": "5px",
4+
"border-radius-round": "999px",
5+
"color-border-base": "#dae2e6",
6+
"color-border-strong": "#1c1d1f",
7+
"color-white": "#ffffff",
8+
"color-black": "#000000",
9+
"color-grey-100": "#f4f5f7",
10+
"color-grey-200": "#e5eaed",
11+
"color-grey-300": "#dae2e6",
12+
"color-grey-400": "#d5d8da",
13+
"color-grey-500": "#aaafb3",
14+
"color-grey-600": "#757982",
15+
"color-grey-700": "#505359",
16+
"color-grey-800": "#1c1d1f",
17+
"color-blue-100": "#eaf5ff",
18+
"color-blue-200": "#d7ecff",
19+
"color-blue-300": "#85c6ff",
20+
"color-blue-400": "#1f97ff",
21+
"color-blue-500": "#006dcc",
22+
"color-blue-600": "#1950a3",
23+
"color-blue-700": "#004480",
24+
"color-blue-800": "#01396a",
25+
"color-green-200": "#e9f5e9",
26+
"color-green-300": "#b0dcb0",
27+
"color-green-400": "#77c377",
28+
"color-green-500": "#5bb75b",
29+
"color-green-600": "#31a549",
30+
"color-green-700": "#3c893c",
31+
"color-green-800": "#2b622b",
32+
"color-red-200": "#fce8e8",
33+
"color-red-300": "#efb1af",
34+
"color-red-400": "#e1706b",
35+
"color-red-500": "#da4f49",
36+
"color-red-600": "#d5382e",
37+
"color-red-700": "#b22a24",
38+
"color-red-800": "#551411",
39+
"color-orange-200": "#ffeed6",
40+
"color-orange-300": "#fddaa9",
41+
"color-orange-400": "#fbb85a",
42+
"color-orange-500": "#faa732",
43+
"color-orange-600": "#f8951d",
44+
"color-orange-700": "#da8205",
45+
"color-orange-800": "#844f01",
46+
"color-cyan-200": "#e8f8fd",
47+
"color-cyan-300": "#c9e7f0",
48+
"color-cyan-400": "#89cbdf",
49+
"color-cyan-500": "#49afcd",
50+
"color-cyan-600": "#0492ba",
51+
"color-cyan-700": "#136480",
52+
"color-cyan-800": "#0c3e4f",
53+
"color-purple-200": "#f4ebfd",
54+
"color-purple-300": "#d8c6ee",
55+
"color-purple-400": "#ad87db",
56+
"color-purple-500": "#9768d1",
57+
"color-purple-600": "#793dc4",
58+
"color-purple-700": "#582a91",
59+
"color-purple-800": "#35175a",
60+
"color-teal-200": "#ddfffc",
61+
"color-teal-300": "#abebe5",
62+
"color-teal-400": "#48dbcc",
63+
"color-teal-500": "#00b8a5",
64+
"color-teal-600": "#008577",
65+
"color-teal-700": "#006c60",
66+
"color-teal-800": "#00342e",
67+
"color-yellow-200": "#fff3cc",
68+
"color-yellow-300": "#f6e097",
69+
"color-yellow-400": "#f2d471",
70+
"color-yellow-500": "#efc94c",
71+
"color-yellow-600": "#eab919",
72+
"color-yellow-700": "#ba9311",
73+
"color-yellow-800": "#7c6109",
74+
"color-text-base": "#1c1d1f",
75+
"color-text-soft": "#505359",
76+
"color-text-label": "#505359",
77+
"color-text-disabled": "#757982",
78+
"color-text-placeholder": "#757982",
79+
"color-text-description": "#757982",
80+
"color-text-inverse": "#ffffff",
81+
"color-default-soft": "#e5eaed",
82+
"color-default-accent": "#dae2e6",
83+
"color-default-base": "#aaafb3",
84+
"color-default-strong": "#1c1d1f",
85+
"color-primary-soft": "#d7ecff",
86+
"color-primary-accent": "#85c6ff",
87+
"color-primary-base": "#006dcc",
88+
"color-primary-strong": "#1950a3",
89+
"color-success-soft": "#e9f5e9",
90+
"color-success-accent": "#b0dcb0",
91+
"color-success-base": "#5bb75b",
92+
"color-success-strong": "#31a549",
93+
"color-danger-soft": "#fce8e8",
94+
"color-danger-accent": "#efb1af",
95+
"color-danger-base": "#da4f49",
96+
"color-danger-strong": "#d5382e",
97+
"color-warning-soft": "#ffeed6",
98+
"color-warning-accent": "#fddaa9",
99+
"color-warning-base": "#faa732",
100+
"color-warning-strong": "#f8951d",
101+
"color-info-soft": "#e8f8fd",
102+
"color-info-accent": "#c9e7f0",
103+
"color-info-base": "#49afcd",
104+
"color-info-strong": "#0492ba",
105+
"color-secondary-soft": "#ddfffc",
106+
"color-secondary-accent": "#abebe5",
107+
"color-secondary-base": "#00b8a5",
108+
"color-secondary-strong": "#008577",
109+
"font-size-xlarge": "24px",
110+
"font-size-large": "18px",
111+
"font-size-medium": "15px",
112+
"font-size-base": "12px",
113+
"font-size-small": "11px",
114+
"font-size-xsmall": "9px",
115+
"font-weight-normal": 400,
116+
"font-weight-bold": 700
117+
}

system/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"license": "MIT",
1111
"scripts": {
1212
"system:dist": "rimraf tokens/* internal/* && style-dictionary build && npm run system:format",
13-
"system:format": "prettier \"internal/index.js\" \"tokens/**.json\" --write",
13+
"system:format": "prettier \"internal/**.{js,json}\" \"tokens/**.json\" --write",
1414
"convert": "node ./scripts/convertXdCssVars.mjs"
1515
},
1616
"sideEffects": false

0 commit comments

Comments
 (0)