Add support for color mode defined by color name prefix #218#235
Add support for color mode defined by color name prefix #218#235fedulvtubudul wants to merge 1 commit intoRedMadRobot:masterfrom
Conversation
| let lightPrefix = colorParams?.lightModePrefix | ||
| let darkPrefix = colorParams?.darkModePrefix | ||
| let lightSuffix = colorParams?.lightModeSuffix | ||
| let darkSuffix = colorParams?.darkModeSuffix |
There was a problem hiding this comment.
To maintain backward compatibility
| let darkSuffix = colorParams?.darkModeSuffix | |
| let darkSuffix = colorParams?.darkModeSuffix ?? "_dark" |
There was a problem hiding this comment.
This makes no sense for me. Someone can use suffix, someone can use prefix, but not both. So if I only have suffixes in my Figma, how would I configure my figma-export with such default values?
| let lightColors = colors | ||
| .filter { | ||
| !$0.name.hasSuffix(darkSuffix) && | ||
| !$0.name.hasSuffix(lightHCSuffix) && | ||
| !$0.name.hasSuffix(darkHCSuffix) | ||
| } |
There was a problem hiding this comment.
If you would like to specify light and dark colors in the same file, you can do so with the useSingleFile configuration option. You can then denote dark mode colors by adding a suffix like _dark.
(from https://github.com/RedMadRobot/figma-export?tab=readme-ov-file#design-requirements)
You must not delete this code. A color style list can contains colors which names doesn't contain prefixes and suffixes for light mode but contain "dark" suffix/prefix for dark mode. Example: "background", "foreground", "dark_background", "dark_foreground".
|
@fedulvtubudul Do you plan to continue work on the PR? |
09f1aeb to
154b34e
Compare
No description provided.