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
https://github.com/intuit/postcss-themed/pull/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.
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 overridedefaultTheme.light
andtheme.dark
should overridedefaultTheme.dark
(nottheme.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
https://github.com/intuit/postcss-themed/pull/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:
yarn all-contributors add [name] [type]
) see https://github.com/all-contributors/all-contributors/blob/master/docs/cli/usage.mdPublished PR with canary version:
2.8.1-canary.61.736