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

Fixed image and icons export for iOS with additional suffix #174

Closed sergeirr closed 2 years ago

sergeirr commented 2 years ago

Fixed image export with suffix for dark mode Fixed icons export with suffix for renderMode mode (dark mode suffix should be last)

subdan commented 2 years ago

Hello. Could you please explain in more detail which bug have you fixed?

sergeirr commented 2 years ago
  1. Fixed image export with suffix for dark mode. In case you set 'useSingleFile' to true you will always get 'secondAssetsNotFoundInFirstPalette' error. This was because the '_dark' suffix is not removed from image name.
  2. Fixed icons export with suffix for renderMode mode (dark mode suffix should be last) In case you set 'renderModeDefaultSuffix', 'renderModeOriginalSuffix' or 'renderModeTemplateSuffix' you will always get 'renderMode' on icons in assets. This was because the 'renderMode' suffix is not removed from icon name before being renamed to camelCase or snakeCase.
subdan commented 2 years ago

Thanks for the PR, @ne1true! This fix will be released in 0.34.2 within an hour.

subdan commented 2 years ago

I've just noticed that you call updateRenderMode in loadIconsFromSingleFile method only. You've forgotten to call updateRenderMode in loadIconsFromLightAndDarkFile.

sergeirr commented 2 years ago

Sorry, I forgot about this function. Do I need to create new pr with that fix?

subdan commented 2 years ago

No, I'll do it myself.

sergeirr commented 2 years ago

You can also remove the renderMode fields from XcodeImagesOutput.