Skip to content
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

Support a logo for the dark theme #674

Closed
choldgraf opened this issue May 22, 2022 · 0 comments · Fixed by #691
Closed

Support a logo for the dark theme #674

choldgraf opened this issue May 22, 2022 · 0 comments · Fixed by #691
Assignees
Milestone

Comments

@choldgraf
Copy link
Collaborator

Context

In #673 we are adding classes to support theme-specific images, content, etc. Basically, the classes will make an image display: none when the opposing theme is active.

A common use-case for theme-specific content is images, and this is one case where it'd be trickier for users to use this functionality.

Proposal

We should make it possible for users to define a "Dark Theme logo" that would be added to the site HTML with the dark-only class, and make our current html_logo image use the light-only class.

I think that the place to implement this would be in our navbar logo component:

{% if logo %}
{% if not theme_logo_link %}
<a class="navbar-brand" href="{{ pathto(master_doc) }}">
<img src="{{ pathto('_static/' + logo, 1) }}" class="logo" alt="logo">
</a>
{% elif theme_logo_link[:4] == 'http' %}
<a class="navbar-brand" href="{{ theme_logo_link }}">
<img src="{{ pathto('_static/' + logo, 1) }}" class="logo" alt="logo">
</a>
{% else %}
<a class="navbar-brand" href="{{ pathto(theme_logo_link) }}">
<img src="{{ pathto('_static/' + logo, 1) }}" class="logo" alt="logo">
</a>
{% endif %}
{% else %}
<a class="navbar-brand" href="{{ pathto(master_doc) }}">
<p class="title">{{ project }}</p>
</a>
{% endif %}

And maybe the simplest config would be to also support an html_logo_dark configuration instead of just html_logo.

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

Successfully merging a pull request may close this issue.

2 participants