Skip to content
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

Make type colors themeable #2847

Merged
merged 6 commits into from
May 18, 2024
Merged

Make type colors themeable #2847

merged 6 commits into from
May 18, 2024

Conversation

joeyballentine
Copy link
Member

This PR adds support for changing the type colors via themes.

One important thing i realized when doing this is that we definitely need to not define themes via sass. The amount of dependency lists i've had to add theme to, even though its not used anywhere inside the thing being memo'd, is ridiculous. And the worst part is, I can't do anything about a couple of them. For example, collapsed handles won't change until the node state changes due to how its rendered. Since the colors aren't actually being modified by anything react can see, it has no reason to rerender unless i force it to by misusing dep arrays. I'm pretty sure my theme object solution would take care of this. I'm also open to other solutions.

Anyway, I only implemented different colors for the "ComfortUI" theme to sorta match their colors

image

It's more of a POC than anything else.

src/renderer/helpers/accentColors.ts Show resolved Hide resolved
src/renderer/colors.scss Outdated Show resolved Hide resolved
@joeyballentine
Copy link
Member Author

My solution was to move everything to a custom hook. It still ignores the exhaustive deps thing (idk how else to prevent doing that) but it at least abstracts that behavior out of all these files.

Copy link
Member

@RunDevelopment RunDevelopment left a comment

Choose a reason for hiding this comment

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

Nice!

@joeyballentine joeyballentine merged commit 4bddc84 into main May 18, 2024
4 checks passed
@joeyballentine joeyballentine deleted the extra-theme-vars branch May 18, 2024 21:36
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.

2 participants