tokens-bruecke 3.12.0 → 3.12.2

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,3 +1,15 @@
1
+ ## [3.12.0](https://github.com/tokens-bruecke/figma-plugin/compare/v3.10.0...v3.12.0) (2026-09-08)
2
+
3
+ ### Features
4
+
5
+ - **color:** export color aliases with a separate opacity as composed values ([c2451b7](https://github.com/tokens-bruecke/figma-plugin/commit/c2451b7a8e04ab356be66a583007e987b03088f2)), closes [#91](https://github.com/tokens-bruecke/figma-plugin/issues/91)
6
+ - **import:** write composed colors back to Figma ([4b3e152](https://github.com/tokens-bruecke/figma-plugin/commit/4b3e1526c7013b1213f22758debe4db1f4de8108)), closes [#91](https://github.com/tokens-bruecke/figma-plugin/issues/91)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **import:** report composed colors this Figma version cannot write ([0578075](https://github.com/tokens-bruecke/figma-plugin/commit/0578075c91ace03408eb87041e7f8dd2e6c088da)), closes [figma/plugin-typings#375](https://github.com/figma/plugin-typings/issues/375)
11
+ - **motion:** round-trip named easings and skip scopes on motion variables ([72985de](https://github.com/tokens-bruecke/figma-plugin/commit/72985ded7fdb64ae290725d9894e2e026f21106d))
12
+
1
13
  ## [3.10.0](https://github.com/tokens-bruecke/figma-plugin/compare/v3.9.0...v3.10.0) (2026-09-05)
2
14
 
3
15
  ### Features
package/README.md CHANGED
@@ -560,7 +560,7 @@ Things worth knowing when building a snapshot:
560
560
  - Colors are 0..1 float channels (`{ r, g, b, a }`), as the Plugin API returns them.
561
561
  - `collection.variableIds` preserves the ordering shown in Figma's Variables panel.
562
562
  - Aliases are `{ "type": "VARIABLE_ALIAS", "id": "…" }` and must point at a variable present in the snapshot; otherwise the value exports as `"#missing#"`, matching the REST behaviour for unresolvable references.
563
- - Color aliases with their own opacity come back from the Plugin API as `{ "type": "VARIABLE_EXPRESSION", "expressionFunction": "COMPOSE_COLOR", "expressionArguments": [<alias or rgba>, <0..100 or alias>] }` — pass them through as-is, see [Color aliases with opacity](#color-aliases-with-opacity).
563
+ - Color aliases with their own opacity come back from the Plugin API as `{ "color": <alias or rgba>, "opacity": <0..100 or alias> }` (older Figma Desktop builds used `{ "type": "VARIABLE_EXPRESSION", "expressionFunction": "COMPOSE_COLOR", "expressionArguments": [<alias or rgba>, <0..100 or alias>] }`) — pass either through as-is, see [Color aliases with opacity](#color-aliases-with-opacity).
564
564
 
565
565
  > [!NOTE]
566
566
  > Plugin API objects are live proxies, so `JSON.stringify` may not enumerate their properties. Copy the fields listed in the schema onto plain objects before serializing.
@@ -1081,8 +1081,13 @@ The `alpha` is the opacity Figma applies on top of the referenced color. If the
1081
1081
 
1082
1082
  [Importing](#import-json--variables) these tokens recreates the composed color variable in Figma: `components` becomes the alias, `alpha` the opacity (a plain percentage or an alias to the number variable). References to variables in other collections are resolved once every collection has been imported.
1083
1083
 
1084
+ Figma has exposed these variables to plugins in two shapes so far: current runtimes (the Figma web app, and what `setValueForMode` accepts) use `{ "color": <alias or rgba>, "opacity": <0..100 or alias> }`, while Figma Desktop 126.x returned a `COMPOSE_COLOR` expression. The export reads both. The import writes the current shape and falls back to the expression for runtimes that only accept that one.
1085
+
1084
1086
  > [!WARNING]
1085
- > Some Figma clients can read these variables but refuse to write them ("Composed color variable values are not supported"), currently including Figma Desktop. The plugin then leaves those values untouched, reports how many were skipped and links to [figma/plugin-typings#375](https://github.com/figma/plugin-typings/issues/375). Other tokens in the same import are not affected.
1087
+ > Some Figma clients can read these variables but refuse to write them in either shape ("Composed color variable values are not supported"), including Figma Desktop 126.x. The plugin then leaves those values untouched, reports how many were skipped and links to [figma/plugin-typings#375](https://github.com/figma/plugin-typings/issues/375). Other tokens in the same import are not affected.
1088
+
1089
+ > [!NOTE]
1090
+ > Figma is still changing how these values are exposed to plugins. If a color variable comes back in a shape the plugin does not recognise, the export leaves that variable out and logs a `[tokens-bruecke] Skipped variable …` warning with the raw value to the Figma console (`Plugins → Development → Open console`) instead of failing. Please paste that warning into [#91](https://github.com/tokens-bruecke/figma-plugin/issues/91).
1086
1091
 
1087
1092
  > [!NOTE]
1088
1093
  > This shape is an extension of the DTCG format, so a consumer needs a small custom transform: resolve the `components` reference, then apply `alpha`.