From 85767e4df5f299806b3bb33a10244e2cfcf2fdd5 Mon Sep 17 00:00:00 2001 From: Darren Griffin Date: Thu, 6 Mar 2025 20:28:58 +0000 Subject: [PATCH] Fixes logo to embed light mode / dark mode within (#4736) --- _static/custom.css | 18 ++++----- _templates/search.html | 1 + _templates/searchbox.html | 26 +++++++++++++ components/index.rst | 3 +- conf.py | 1 - guides/contributing.rst | 6 +-- images/index.rst | 3 +- images/logo-docs.svg | 78 ++++++++++++++++++++++++++++++++++++++- images/logo-text.svg | 26 ++++++++++++- index.rst | 4 +- web-api/index.rst | 2 +- 11 files changed, 147 insertions(+), 21 deletions(-) diff --git a/_static/custom.css b/_static/custom.css index bc3a7e6e9..ade0d6c97 100644 --- a/_static/custom.css +++ b/_static/custom.css @@ -4,6 +4,11 @@ --mobile-width-stop: 875; } +svg { + max-width: 100%; + height: auto; +} + .row-odd { background-color: #f3f6f6; } @@ -373,11 +378,6 @@ div.sphinxsidebar input { margin-bottom: 1rem; } - -img.logo { - content: url("/_static/logo-text-on-light.svg"); -} - @media screen and (max-width: 875px) { /* hide search result thumbnails on mobile */ .pagefind-modular-list-thumb { @@ -396,6 +396,10 @@ img.logo { /* dark theme */ @media (prefers-color-scheme: dark) { + :root{ + --logo-text-color: #FFFFFF; + } + .custom-footer{ border-top: 1px solid #ececec; } @@ -426,10 +430,6 @@ img.logo { background: #212121 !important; margin: 0 !important; } - - img.logo { - content: url("/_static/logo-text-on-dark.svg"); - } img.dark-invert { filter: invert(1); diff --git a/_templates/search.html b/_templates/search.html index 04783c2dd..3b5d8e696 100644 --- a/_templates/search.html +++ b/_templates/search.html @@ -1,6 +1,7 @@ {% extends "page.html" %} + {%- block htmltitle -%} {{ _("Search") }} - {{ docstitle }} {%- endblock htmltitle -%} diff --git a/_templates/searchbox.html b/_templates/searchbox.html index 13b8221f8..9459ee8b5 100644 --- a/_templates/searchbox.html +++ b/_templates/searchbox.html @@ -1,3 +1,29 @@ + + + + + + + + + + + + + + + + + + +