@sit-onyx/figma-utils 1.0.0-beta.7 → 1.0.0-beta.8
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.
|
@@ -10,7 +10,7 @@ export const importVariablesCommand = new Command("import-variables")
|
|
|
10
10
|
.option("-n, --filename <string>", "Base name / prefix of the generated variables file. Will append the mode name")
|
|
11
11
|
.option("-d, --dir <string>", "Working directory to use. Defaults to current working directory of the script.")
|
|
12
12
|
.option("-m, --modes <strings...>", "Can be used to only export specific Figma modes. If unset, all modes will be exported as a separate file.")
|
|
13
|
-
.option("-c, --combines-dark-light", "Combines the dark theme data with the light theme data by using the light-dark() CSS function")
|
|
13
|
+
.option("-c, --combines-dark-light", "Combines the dark theme data with the light theme data by using the light-dark() CSS function. The Figma file must include two modes with -light and -dark prefix, e.g. example-light and example-dark.")
|
|
14
14
|
.option("-s, --selector <string>", 'CSS selector to use for the CSS format. You can use {mode} as placeholder for the mode name, so e.g. for the mode named "dark", passing the selector "html.{mode}" will result in "html.dark"', ":root")
|
|
15
15
|
.action(importVariablesCommandAction);
|
|
16
16
|
/**
|
|
@@ -65,7 +65,7 @@ export async function importVariablesCommandAction(options) {
|
|
|
65
65
|
const fullPath = path.join(outputDirectory, `${themeName}.${format.toLowerCase()}`);
|
|
66
66
|
// find the matching theme
|
|
67
67
|
const dataDark = parsedVariables.find((themeData) => themeData.modeName === themeName + "-dark");
|
|
68
|
-
fs.writeFileSync(fullPath, generators[format](data, dataDark));
|
|
68
|
+
fs.writeFileSync(fullPath, generators[format]({ ...data, modeName: themeName }, dataDark));
|
|
69
69
|
}
|
|
70
70
|
else {
|
|
71
71
|
const fullPath = path.join(outputDirectory, `${baseName}.${format.toLowerCase()}`);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sit-onyx/figma-utils",
|
|
3
3
|
"description": "Utility functions and CLI for importing data from the Figma API into different formats (e.g. CSS, SCSS etc.)",
|
|
4
|
-
"version": "1.0.0-beta.
|
|
4
|
+
"version": "1.0.0-beta.8",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"@sit-onyx/figma-utils": "./dist/cli.js"
|