Skip to content

Commit 8a597b5

Browse files
authored
Use favicon instead of logo in wagtail admin (#650)
Starting with 4.0, sites with navbar settings disabled do not have the ability to change the light/dark setting, which was being used in the admin to put a light or dark background on the logo. Determining if the logo is light or dark is a perpetual problem here. Because if this, the default was light background, and a white logo is now unreadable. To simplify it, let's switch to using the favicon. The favicon is much more suitable for this kind of situation.
1 parent 0807576 commit 8a597b5

2 files changed

Lines changed: 5 additions & 14 deletions

File tree

coderedcms/static/coderedcms/css/crx-admin.css

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,13 @@ textarea.monospace,
2727
.crx-logo-custom {
2828
width: auto;
2929
height: auto;
30-
max-height: 80px;
3130
max-width: 100%;
3231
display: block;
3332
}
34-
.crx-logo-container {
35-
box-sizing: border-box;
36-
margin: 0 15px;
37-
}
38-
.crx-logo-container.navbar-light {
39-
background-color: #fff;
40-
border-radius: 6px;
41-
padding: 0.25em;
42-
}
43-
.crx-logo-container.navbar-dark {
44-
background-color: transparent;
33+
34+
.sidebar-custom-branding {
35+
padding: 20px;
36+
margin: 0;
4537
}
4638

4739

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{% extends "wagtailadmin/base.html" %}
22
{% load coderedcms_tags wagtailimages_tags wagtailsettings_tags %}
3-
{% django_setting "CRX_DISABLE_LAYOUT" as disable_layout %}
43

54
{% block furniture %}
65
{% include "coderedcms/includes/crx_banner.html" %}
@@ -9,4 +8,4 @@
98

109
{# NOTE: this must be on a single line, otherwise Django templates will create
1110
whitespace, and wagtail will think the whitespace is the custom logo! #}
12-
{% block branding_logo %}{% if not disable_layout and settings.coderedcms.LayoutSettings.logo %}<div class="crx-logo-container {{settings.coderedcms.LayoutSettings.navbar_color_scheme}}">{% image settings.coderedcms.LayoutSettings.logo original format-webp preserve-svg as logo_image %}<img src="{{ logo_image.url }}" class="crx-logo-custom" alt="Dashboard"></div>{% endif %}{% endblock %}
11+
{% block branding_logo %}{% django_setting "CRX_DISABLE_LAYOUT" as disable_layout %}{% if not disable_layout and settings.coderedcms.LayoutSettings.favicon %}{% image settings.coderedcms.LayoutSettings.favicon original format-webp preserve-svg as logo_image %}<img src="{{ logo_image.url }}" class="crx-logo-custom" alt="Dashboard">{% endif %}{% endblock %}

0 commit comments

Comments
 (0)