color-mode icon indicating copy to clipboard operation
color-mode copied to clipboard

fix: prioritize config preference over stored value when not 'system'

Open abolix opened this issue 4 months ago โ€ข 6 comments

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)

abolix avatar Sep 04 '25 09:09 abolix

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

netlify[bot] avatar Sep 04 '25 09:09 netlify[bot]

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

netlify[bot] avatar Sep 04 '25 09:09 netlify[bot]

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

abolix avatar Nov 11 '25 17:11 abolix

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

danielroe avatar Nov 11 '25 19:11 danielroe

understood but is there any other way that without breaking the functionality we can implement this ?

abolix avatar Nov 21 '25 18:11 abolix

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?

danielroe avatar Nov 24 '25 09:11 danielroe