@gen3/toolsff 0.12.18 → 0.12.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -106,7 +106,7 @@ const utilityContrast = {
106
106
  category4: '#1b1b1b'
107
107
  };
108
108
  const main = ()=>{
109
- const { values: { themeFile, out, colorShift, colorSaturation } } = parseArgs({
109
+ const { values: { themeFile, out, colorShift, colorSaturation, vars } } = parseArgs({
110
110
  options: {
111
111
  themeFile: {
112
112
  type: 'string',
@@ -125,6 +125,9 @@ const main = ()=>{
125
125
  colorSaturation: {
126
126
  type: 'string',
127
127
  default: '20'
128
+ },
129
+ vars: {
130
+ type: 'boolean'
128
131
  }
129
132
  }
130
133
  });
@@ -143,6 +146,25 @@ const main = ()=>{
143
146
  flag: 'r'
144
147
  });
145
148
  const themeColors = JSON.parse(themeData);
149
+ if (vars) {
150
+ // vars only output
151
+ const theme = [
152
+ ...Object.keys(themeColors),
153
+ 'utility',
154
+ 'table',
155
+ 'navigation'
156
+ ].reduce((acc, colorName)=>{
157
+ for (const value of Object.values(colorType)){
158
+ const colorVar = `${colorName}${value !== 'DEFAULT' ? '-' + value : ''}`;
159
+ const contrastColorVar = `${colorName}-contrast${value !== 'DEFAULT' ? '-' + value : ''}`;
160
+ acc[colorVar] = `var(--${colorVar})`;
161
+ acc[contrastColorVar] = `var(--${contrastColorVar})`;
162
+ }
163
+ return acc;
164
+ }, {});
165
+ writeFileSync(join(out ?? './', 'themeColorCSSVars.json'), JSON.stringify(theme, null, 2));
166
+ return;
167
+ }
146
168
  // build a list of colors
147
169
  const theme = Object.entries(themeColors).reduce((acc, [colorName, colorValue])=>{
148
170
  acc[colorName] = create10ColorPallet(colorValue, shift, saturation);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gen3/toolsff",
3
- "version": "0.12.18",
3
+ "version": "0.12.19",
4
4
  "description": "tools for processing Gen3 commons content: color theme, icons, sharedFilters",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -48,5 +48,5 @@
48
48
  "axios": "^1.8.2"
49
49
  }
50
50
  },
51
- "gitHead": "c2ac83f02ed36f555cfd44af95a56160496803b8"
51
+ "gitHead": "33d2c9c73e0cb7cb08473dc35d5c04ec4c1c2e12"
52
52
  }