-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
WEB: Added theme dependent favicon #42325
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
Conversation
Co-authored-by: attack68 <[email protected]>
Co-authored-by: attack68 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm.
cc @datapythonista if any comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution @DeviousLab. Looks fine, but I think we can get a way simpler implementation. Your code is only executed at load time, so why not leave the html as is (just adding an id), and the javascript simply have an if to check if the theme is dark, and if it change the href value?
Simplified code as requested, now updates the favicon without requiring refresh through use of a event listener. And now just updates the href of the current favicon.
@datapythonista I probably have done it this way in the first place, but I've made the changes you've requested, now updates the favicon without requiring refresh through use of a event listener. And now just updates the href of the current favicon. Definitely a lot simpler. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think a theme update is something we need to worry about, but in any case, this is much clearer, looks good to me.
Thanks for working on it @DeviousLab
Are there any more changes that need to be made? Or can it be safely merged without conflicts? |
Sorry for the delay @DeviousLab. We usually require two core devs to review a PR before merging, let's wait a bit more and see if someone else can have a look. Thanks for your patience. |
No worries! just thought I might have been missing something |
@jreback Does this look good to you? |
thanks @DeviousLab |
Added a light mode version of the favicon based upon the .svgs in the static folder as well as added a small js scipt to the template page to detect the theme change.