Skip to content

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

Merged
merged 5 commits into from
Jul 9, 2021
Merged

WEB: Added theme dependent favicon #42325

merged 5 commits into from
Jul 9, 2021

Conversation

DeviousLab
Copy link
Contributor

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.

mgCmqcreiy

@simonjayhawkins simonjayhawkins added the Web pandas website label Jun 30, 2021
Copy link
Contributor

@attack68 attack68 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm.

@jreback jreback added this to the 1.4 milestone Jul 1, 2021
@jreback
Copy link
Contributor

jreback commented Jul 1, 2021

cc @datapythonista if any comment

Copy link
Member

@datapythonista datapythonista left a 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.
@DeviousLab
Copy link
Contributor Author

@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.
363GRl3Xq6

@DeviousLab DeviousLab requested a review from datapythonista July 2, 2021 08:49
Copy link
Member

@datapythonista datapythonista left a 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

@DeviousLab
Copy link
Contributor Author

Are there any more changes that need to be made? Or can it be safely merged without conflicts?

@datapythonista
Copy link
Member

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.

@DeviousLab
Copy link
Contributor Author

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

@DeviousLab
Copy link
Contributor Author

@jreback Does this look good to you?

@jreback jreback merged commit 386bad4 into pandas-dev:master Jul 9, 2021
@jreback
Copy link
Contributor

jreback commented Jul 9, 2021

thanks @DeviousLab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Web pandas website
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WEB: Use appropriate favicon when user has browser in dark mode
5 participants