FIX: Offer site_logo_dark_url as an option for dark mode themes (#14361)

This commit is contained in:
jbrw
2021-09-16 17:47:51 -04:00
committed by GitHub
parent ae09b46098
commit da88cad648
3 changed files with 71 additions and 1 deletions

View File

@@ -5,7 +5,12 @@
<div class="title">
<a href="<%= path "/" %>">
<%- if application_logo_url.present? %>
<img src="<%= application_logo_url %>" alt="<%= SiteSetting.title %>" id="site-logo">
<picture>
<%- if application_logo_dark_url.present? %>
<source srcset="<%= application_logo_dark_url %>" media="(prefers-color-scheme: dark)" />
<%- end %>
<img src="<%= application_logo_url %>" alt="<%= SiteSetting.title %>" id="site-logo" />
</picture>
<%- else %>
<h2 id='site-text-logo'><%= SiteSetting.title %></h2>
<%- end %>