-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for color mode defined by color name prefix #218 #235
base: master
Are you sure you want to change the base?
Add support for color mode defined by color name prefix #218 #235
Conversation
let lightPrefix = colorParams?.lightModePrefix | ||
let darkPrefix = colorParams?.darkModePrefix | ||
let lightSuffix = colorParams?.lightModeSuffix | ||
let darkSuffix = colorParams?.darkModeSuffix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To maintain backward compatibility
let darkSuffix = colorParams?.darkModeSuffix | |
let darkSuffix = colorParams?.darkModeSuffix ?? "_dark" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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? |
No description provided.