tokens-bruecke 2.9.4 → 2.11.1

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.
package/CHANGELOG.md CHANGED
@@ -1,53 +1,58 @@
1
1
  # Changelog
2
2
 
3
- ## [2.9.4](https://github.com/tokens-bruecke/figma-plugin/compare/v2.9.3...v2.9.4) (2026-01-13)
3
+ ## [2.11.1](https://github.com/tokens-bruecke/figma-plugin/compare/v2.11.0...v2.11.1) (2026-03-28)
4
+
5
+ ### Bug Fixes
6
+
7
+ - **normilizeType:** return `string` instead of `dimension` for percentage opacity
4
8
 
9
+ ## [2.11.0](https://github.com/tokens-bruecke/figma-plugin/compare/v2.10.0...v2.11.0) (2026-03-28)
10
+
11
+ ### Features
12
+
13
+ - **cli:** add `--oauth-token` flag to support OAuth authentication ([#65](https://github.com/tokens-bruecke/figma-plugin/issues/65))
14
+
15
+ ## [2.9.4](https://github.com/tokens-bruecke/figma-plugin/compare/v2.9.3...v2.9.4) (2026-01-13)
5
16
 
6
17
  ### Bug Fixes
7
18
 
8
- * hardcoded style colors into variables ([403c4a5](https://github.com/tokens-bruecke/figma-plugin/commit/403c4a582da3cd7f1d3a4af3654660b84275c9dc))
19
+ - hardcoded style colors into variables ([403c4a5](https://github.com/tokens-bruecke/figma-plugin/commit/403c4a582da3cd7f1d3a4af3654660b84275c9dc))
9
20
 
10
21
  ## [2.9.3](https://github.com/tokens-bruecke/figma-plugin/compare/v2.9.2...v2.9.3) (2025-12-06)
11
22
 
12
-
13
23
  ### Bug Fixes
14
24
 
15
- * Remove pnpm version and install options in release workflow ([62ea535](https://github.com/tokens-bruecke/figma-plugin/commit/62ea535c12639ab21b056eb08209fa1115d33920))
25
+ - Remove pnpm version and install options in release workflow ([62ea535](https://github.com/tokens-bruecke/figma-plugin/commit/62ea535c12639ab21b056eb08209fa1115d33920))
16
26
 
17
27
  ## [2.9.2](https://github.com/tokens-bruecke/figma-plugin/compare/v2.9.1...v2.9.2) (2025-12-06)
18
28
 
19
-
20
29
  ### Bug Fixes
21
30
 
22
- * Add zip existence check and force artifact upload ([f9d9b4b](https://github.com/tokens-bruecke/figma-plugin/commit/f9d9b4b8aa7b79cb858140fc0fed2e24eca1faca))
31
+ - Add zip existence check and force artifact upload ([f9d9b4b](https://github.com/tokens-bruecke/figma-plugin/commit/f9d9b4b8aa7b79cb858140fc0fed2e24eca1faca))
23
32
 
24
33
  ## [2.9.1](https://github.com/tokens-bruecke/figma-plugin/compare/v2.9.0...v2.9.1) (2025-12-06)
25
34
 
26
-
27
35
  ### Bug Fixes
28
36
 
29
- * Add Release Please configuration files ([dcedd19](https://github.com/tokens-bruecke/figma-plugin/commit/dcedd19dc186bb97bb770af7701be5c8f821f861))
37
+ - Add Release Please configuration files ([dcedd19](https://github.com/tokens-bruecke/figma-plugin/commit/dcedd19dc186bb97bb770af7701be5c8f821f861))
30
38
 
31
39
  ## [2.7.0](https://github.com/tokens-bruecke/figma-plugin/compare/v2.6.2...v2.7.0) (2025-09-21)
32
40
 
33
-
34
41
  ### Features
35
42
 
36
- * Add direct new GitHub token URL with "repo" scope ([f2f68f9](https://github.com/tokens-bruecke/figma-plugin/commit/f2f68f91bb20ded52cb193391bf4eeaca0e6d303))
37
- * Add direct new GitHub token URL with "repo" scope ([aea4d98](https://github.com/tokens-bruecke/figma-plugin/commit/aea4d983b99892f28040b919bc79b161fe4e4aa2))
38
-
43
+ - Add direct new GitHub token URL with "repo" scope ([f2f68f9](https://github.com/tokens-bruecke/figma-plugin/commit/f2f68f91bb20ded52cb193391bf4eeaca0e6d303))
44
+ - Add direct new GitHub token URL with "repo" scope ([aea4d98](https://github.com/tokens-bruecke/figma-plugin/commit/aea4d983b99892f28040b919bc79b161fe4e4aa2))
39
45
 
40
46
  ### Bug Fixes
41
47
 
42
- * file path must be URL-encoded for Gitlab API ([369d43f](https://github.com/tokens-bruecke/figma-plugin/commit/369d43fd01d04ea44a810ebcada07a97c5924072))
43
- * URL encode file path for Gitlab API ([6a590b1](https://github.com/tokens-bruecke/figma-plugin/commit/6a590b15966d4b4188d210d6d8a7dcd4ab07884f))
48
+ - file path must be URL-encoded for Gitlab API ([369d43f](https://github.com/tokens-bruecke/figma-plugin/commit/369d43fd01d04ea44a810ebcada07a97c5924072))
49
+ - URL encode file path for Gitlab API ([6a590b1](https://github.com/tokens-bruecke/figma-plugin/commit/6a590b15966d4b4188d210d6d8a7dcd4ab07884f))
44
50
 
45
51
  ## [2.6.2](https://github.com/tokens-bruecke/figma-plugin/compare/v2.6.1...v2.6.2) (2025-06-01)
46
52
 
47
-
48
53
  ### Bug Fixes
49
54
 
50
- * prettier and file formatting ([43bbca5](https://github.com/tokens-bruecke/figma-plugin/commit/43bbca5a922a2d5653704c56b0c2d6e1060855d2))
55
+ - prettier and file formatting ([43bbca5](https://github.com/tokens-bruecke/figma-plugin/commit/43bbca5a922a2d5653704c56b0c2d6e1060855d2))
51
56
 
52
57
  ## [2.6.1](https://github.com/tokens-bruecke/figma-plugin/compare/v2.6.0...v2.6.1) (2025-04-17)
53
58
 
package/README.md CHANGED
@@ -18,11 +18,14 @@ The plugin converts Figma variables into design-tokens JSON that are compatible
18
18
  - [New version 2.0.0](#new-version-200)
19
19
  - [How to use](#how-to-use)
20
20
  - [Export and Import](#export-and-import)
21
+ - [Export (Variables → JSON)](#export-variables--json)
22
+ - [Import (JSON → Variables)](#import-json--variables)
21
23
  - [General settings](#general-settings)
22
24
  - [Color mode](#color-mode)
23
25
  - [Include styles](#include-styles)
24
26
  - [Add styles to](#add-styles-to)
25
27
  - [Include variable scopes](#include-variable-scopes)
28
+ - [Use percentage for opacity](#use-percentage-for-opacity)
26
29
  - [Use DTCG keys format](#use-dtcg-keys-format)
27
30
  - [Include `.value` string for aliases](#include-value-string-for-aliases)
28
31
  - [Include Figma metadata](#include-figma-metadata)
@@ -80,11 +83,13 @@ You can download and install previos version `1.6.1` here — [github.com/tokens
80
83
  The plugin supports both **exporting** and **importing** design tokens:
81
84
 
82
85
  #### Export (Variables → JSON)
86
+
83
87
  - Click **"Download JSON"** to export your Figma variables as a design tokens JSON file
84
88
  - The exported file is compatible with the [Design Tokens specification](https://design-tokens.github.io/community-group/format/)
85
89
  - You can also push directly to supported services (JSONBin, GitHub, GitLab, etc.)
86
90
 
87
91
  #### Import (JSON → Variables)
92
+
88
93
  - Click **"Import JSON"** to import design tokens from a JSON file back into Figma
89
94
  - The plugin will create variable collections, modes, and variables based on the JSON structure
90
95
  - Supports both DTCG format (`$value`, `$type`) and standard format (`value`, `type`)
@@ -92,6 +97,7 @@ The plugin supports both **exporting** and **importing** design tokens:
92
97
  - Creates new collections and variables as needed, or updates existing ones
93
98
 
94
99
  **Import Features:**
100
+
95
101
  - ✅ Creates variable collections from top-level objects
96
102
  - ✅ Supports multiple modes (from `$extensions.mode` or `extensions.mode`)
97
103
  - ✅ Handles all variable types (color, number, string, boolean)
@@ -99,6 +105,9 @@ The plugin supports both **exporting** and **importing** design tokens:
99
105
  - ✅ Supports various color formats (HEX, RGBA CSS, RGBA Object)
100
106
  - ✅ Preserves variable descriptions and metadata
101
107
 
108
+ > [!WARNING]
109
+ > **Styles Export Limitation**: If you exported tokens with styles included (typography, grids, shadows, or blur), these cannot be imported back as Figma styles or variables. Figma's variable API currently only supports basic types: `color`, `number`, `string`, `boolean`, and `dimension`. Complex style types will be imported as `STRING` variables without proper value conversion. This is a temporary limitation until Figma supports these types natively in their API.
110
+
102
111
  ---
103
112
 
104
113
  ## General settings
@@ -143,6 +152,28 @@ Each Figma variable has a [scope property](https://www.figma.com/plugin-docs/api
143
152
  }
144
153
  ```
145
154
 
155
+ ### Use percentage for opacity
156
+
157
+ Is `off` by default. When enabled, opacity values will be exported as percentages instead of normalized decimal values. This affects variables with the `OPACITY` scope.
158
+
159
+ ```json
160
+ // Without percentage format (default)
161
+ {
162
+ "opacity": {
163
+ "type": "number",
164
+ "value": 0.1
165
+ }
166
+ }
167
+
168
+ // With percentage format
169
+ {
170
+ "opacity": {
171
+ "type": "string",
172
+ "value": "10%"
173
+ }
174
+ }
175
+ ```
176
+
146
177
  ### Use DTCG keys format
147
178
 
148
179
  Is `off` by default. Currently many design tokens tools doesn't support [DTCG keys format](https://design-tokens.github.io/community-group/format/#character-restrictions). All DTCG keys are prefixed with `$` symbol.
@@ -244,14 +275,29 @@ tokens-bruecke [options]
244
275
  For example:
245
276
 
246
277
  ```bash
278
+ # Using a Personal Access Token (PAT)
247
279
  tokens-bruecke --api-key $FIGMA_TOKEN --file-key $FIGMA_FILE --config config.json --output out/tokens.json
280
+
281
+ # Using an OAuth token
282
+ tokens-bruecke --oauth-token $FIGMA_OAUTH_TOKEN --file-key $FIGMA_FILE --config config.json --output out/tokens.json
248
283
  ```
249
284
 
250
285
  This will fetch figma variables and export them in `out/tokens.json`
251
286
 
252
287
  ### Options
253
288
 
254
- Same options than the plugin are available throught the usage of a json file.
289
+ | Option | Alias | Description | Required |
290
+ | --------------- | ----- | --------------------------------- | ------------------------------------------------- |
291
+ | `--api-key` | `-a` | Figma personal access token (PAT) | One of `--api-key` or `--oauth-token` is required |
292
+ | `--oauth-token` | `-t` | Figma OAuth token | One of `--api-key` or `--oauth-token` is required |
293
+ | `--file-key` | `-f` | Figma file key | Yes |
294
+ | `--output` | `-o` | Path to output file | Yes |
295
+ | `--config` | `-c` | Path to configuration file | No |
296
+
297
+ > [!TIP]
298
+ > For automated pipelines, `--oauth-token` is preferred over `--api-key`. Personal Access Tokens expire every 90 days and require manual renewal, while OAuth tokens support programmatic refresh for indefinite access.
299
+
300
+ Other export settings are available through a JSON configuration file (see [CLI Configuration File](#cli-configuration-file) below).
255
301
 
256
302
  ### CLI Configuration File
257
303
 
@@ -269,6 +315,7 @@ You can use a JSON configuration file to specify the export options for the CLI.
269
315
  "useDTCGKeys": false,
270
316
  "includeValueStringKeyToAlias": true,
271
317
  "includeFigmaMetaData": false, // Include Figma metadata like styleId, variableId, etc.
318
+ "usePercentageOpacity": false, // Export opacity as percentage (10%) instead of decimal (0.1)
272
319
  "colorMode": "hex", // "hex" | "rgba-object" | "rgba-css" | "hsla-object" | "hsla-css";
273
320
  "storeStyleInCollection": "none" // Name of one of your collection or "none" to keep them separated
274
321
  }
@@ -659,7 +706,7 @@ In order to validate types, the plugin uses the [Design Tokens types](https://gi
659
706
  In order to convert `FONT-WEIGHT` and `OPACITY` types into valid values you should specify thme as scopes in the Figma variables. The plugin will read the first scope and convert it into the valid value. If there are multiple scopes, the plugin will take the first one.
660
707
 
661
708
  - `FONT_WEIGHT` scope will be converted into `string` type.
662
- - `OPACITY` scope will be converted into `number` type.
709
+ - `OPACITY` scope will be converted into `number` type (or `string` with `%` if "Use percentage for opacity" is enabled).
663
710
 
664
711
  ---
665
712