RedMadRobot / figma-export

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

Support for Universal Colors #68

Closed JonLz closed 3 years ago

JonLz commented 3 years ago

I was curious about the validation that ensures there is a corresponding dark mode color for every light mode color. In some cases, a design system might only have a single color that is used across both the light and dark color palette.

Consider something like this: image

What do you think about adding a configuration option to opt out of that warning? Then the xcode exporter step can check if only a light color exists, it turns it into a color set with the None appearances option. This color will then not respond to appearance changes.

subdan commented 3 years ago

I added this validation to show an error when a designer forget to add a dark variant of color that exists in light palette. Your proposal is correct. Some colors might be universal. I think we can modify this validation to treat error as warning. FigmaExport will not stop exporting colors if there is no dark color for light color with the same name and vise versa. FigmaExport will shows warning in the output: Using color COLOR_NAME as universal color because it is not found in the dark palette. This rule will also apply to illustrations.