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

Fix: Dark mode logic #61

Merged
merged 4 commits into from
Jun 1, 2021
Merged

Fix: Dark mode logic #61

merged 4 commits into from
Jun 1, 2021

Conversation

kharrop
Copy link
Collaborator

@kharrop kharrop commented May 28, 2021

What Changed

Updating the dark mode logic to match the previous way design data was referenced, where theme-specific values should be compared back to the default theme, not to each other.

Meaning theme.light should override defaultTheme.light and theme.dark should override defaultTheme.dark (not theme.light).

You can test this by having a theme use the same value for dark and light mode. Previously, if the values were the same, the dark mode value would use the default theme dark value. This PR fixes this where the dark value for the theme will be used as expected.

Why

#48 introduced some new logic that said if the dark scheme value was the same as the light value, don't include it. However, the logic should be if the dark scheme value for the default theme is the same as light, don't include it.

Updating the logic to be default theme specific, since we want to be able to supply the same value for dark and light schemes in non-default themes.

Todo:

Published PR with canary version: 2.8.1-canary.61.736

@kharrop kharrop marked this pull request as draft May 28, 2021 17:48
@kharrop kharrop marked this pull request as ready for review May 28, 2021 19:31
@kharrop kharrop changed the title Fixing dark mode logic Fix: Dark mode logic May 28, 2021
Copy link

@fattslug fattslug left a comment

Choose a reason for hiding this comment

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

🔥

@adierkens adierkens added the patch Increment the patch version when merged label Jun 1, 2021
@adierkens adierkens merged commit 5bbd8e3 into intuit:master Jun 1, 2021
@hipstersmoothie
Copy link
Contributor

🚀 PR was released in v2.8.1 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Increment the patch version when merged released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants