Skip to content

作者

novlan1

2025.10.21

Figma 变量提取

目标

将 Figma 的变量转成 CSS 变量,可以在代码中使用。

方式

尝试使用 open api,权限不够,需要 file_read 或者 file_variables:read 权限。 参考:https://developers.figma.com/docs/rest-api/variables/

当前使用的是现成的插件 Export/Import Variables,然后处理数据。

数据

处理后的数据目录:https://github.com/novlan1/plugin-light/tree/master/packages/plugin-light-cli/script/figma/variables/data-parsed

原理数据目录:https://github.com/novlan1/plugin-light/tree/master/packages/plugin-light-cli/script/figma/variables/data/