RedMadRobot / figma-export

Command line utility to export colors, typography, icons and images from Figma to Xcode / Android Studio project
MIT License
718 stars 114 forks source link

figmaFrameName for colors export #167

Closed ink1804 closed 2 years ago

ink1804 commented 2 years ago

Hello, how can I use figma-export for single frame in file? It works for icons or images, but not for colors. figma-export colors exports colors from all frames i have in file.

subdan commented 2 years ago

Hello.

You don't need to specify a frame to export colors.

figma-export colors command exports colors only from Color Styles. You can see all the Color Styles of your Figma File in the right sidebar (Inspect).

Screen Shot 2022-05-14 at 11 42 16

To be able to export the Color Styles using FigmaExport you must publish it.

image

In the example Figma file I added colors to a frame just for convenience, to visually show all the colors.

ink1804 commented 2 years ago

Is it possible to export single style or several styles? I have "Base" colors and special colors for different apps("App1" and "App2") so i need to export only "Base" colors and dont export "App1" and "App2" colors. Is it possible?

subdan commented 2 years ago

There are 3 possible solutions:

  1. Don‘t publish "special colors". FigmaExport exports only published Color Styles.

  2. In the description field of the "special color" Color Styles type "none". FigmaExport doesn’t export Color Styles which contains a word "none" or "android".

    image
  3. I can add an argument for figma-export colors command to specify a list of exported Color Styles. For example figma-export colors -i figma-export.yaml "Base/*" command will exports only Base colors. This is not supported right now but I can add this in the next version of FigmaExport.

ink1804 commented 2 years ago

Wow, third variant would be so cool! I'll waiting for it, thank you very much ^^,

subdan commented 2 years ago

Done! Please update to the latest version (0.34.0) and try to export colors.

ink1804 commented 2 years ago

It works! You solved a lot of our problems! Thank you very much! <3