Fix: Color Mode Switcher shows wrong icon in auto mode #546#547
Fix: Color Mode Switcher shows wrong icon in auto mode #546#547nenadvicentic wants to merge 1 commit intotwbs:mainfrom
Conversation
|
Thanks for the PR! Apologies for the delay in reviewing it. I’ve tested it but wasn’t able to reproduce the occasional flickering issue that could happen in the |
|
Apologies for not so clear pull request description. Regardless of flickering issue (which turned out to be present only in Chrome, not in FF, when script tag is in the page header), you have a bug in the current switcher. You can see it when you land on a website that uses themes and switcher and there is no local storage value If your OS is in the light mode, the switcher will show "Light mode" option as selected. If your OS is in the dark mode, switcher will show "Dark mode" option, when, instead, it should show "auto", since "auto" means "whatever is selected in the OS". |
…ntributes to occasional flickering. twbs#546 - Unifies 'auto' and `null` handling for `theme` to simplify code and avoid occasional flickering.
Root cause (different handling for
nullandautovalues) contributes to occasional flickering.