Skip to content

Conversation

fedulvtubudul
Copy link

No description provided.

let lightPrefix = colorParams?.lightModePrefix
let darkPrefix = colorParams?.darkModePrefix
let lightSuffix = colorParams?.lightModeSuffix
let darkSuffix = colorParams?.darkModeSuffix
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To maintain backward compatibility

Suggested change
let darkSuffix = colorParams?.darkModeSuffix
let darkSuffix = colorParams?.darkModeSuffix ?? "_dark"

Copy link
Author

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?

@subdan
Copy link
Collaborator

subdan commented Mar 28, 2024

Please, update CONFIG.md and README.md. Add information about prefixes.

Comment on lines -45 to -50
let lightColors = colors
.filter {
!$0.name.hasSuffix(darkSuffix) &&
!$0.name.hasSuffix(lightHCSuffix) &&
!$0.name.hasSuffix(darkHCSuffix)
}
Copy link
Collaborator

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".

@subdan
Copy link
Collaborator

subdan commented Apr 8, 2024

@fedulvtubudul Do you plan to continue work on the PR?

@subdan subdan force-pushed the master branch 2 times, most recently from 09f1aeb to 154b34e Compare January 25, 2025 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants