fix: prioritize config preference over stored value when not 'system'
This fixes an issue where explicitly configured color mode preferences (like preference: 'light') would be overridden by previously stored values from localStorage/cookies.
When a user sets preference to a specific mode (not 'system'), it should take precedence over any stored preferences from previous sessions.
Fixes: Color mode preference not respected when switching between projects
๐ Linked issue
Fixes #318
โ Type of change
- [ ] ๐ Documentation (updates to the documentation or readme)
- [x] ๐ Bug fix (a non-breaking change that fixes an issue)
- [ ] ๐ Enhancement (improving an existing functionality)
- [ ] โจ New feature (a non-breaking change that adds functionality)
- [ ] ๐งน Chore (updates to the build process or auxiliary tools and libraries)
- [ ] โ ๏ธ Breaking change (fix or feature that would cause existing functionality to change)
Deploy Preview for nuxt-color-mode processing.
| Name | Link |
|---|---|
| Latest commit | bbfadef2fb7625572562d4335350f928e90ef21e |
| Latest deploy log | https://app.netlify.com/projects/nuxt-color-mode/deploys/68b957c19f68c70007611b3a |
Deploy Preview for nuxt-color-mode canceled.
| Name | Link |
|---|---|
| Latest commit | dc1002d688e47b723546a504d9b0cfbf456ce64f |
| Latest deploy log | https://app.netlify.com/projects/nuxt-color-mode/deploys/68c1335d958d5500086fc276 |
Well it's not exactly the problem, can you please look at the issue #318 so I don't have to explain all over again ?
it's mainly about running 2 project in different times at the same port when one project is forced on dark and one is forced on light, it does not switch automatically and we have to clear localstorage
i read it but i'm have you understood my comment?
this change breaks the functionality of this module in production by changing a 'default' to an override
understood but is there any other way that without breaking the functionality we can implement this ?
would you spell out your desired behaviour, as clearly as possible, and addressing any edge cases or differences between how things work in production and in development?