Skip to content

Commit 85767e4

Browse files
Fixes logo to embed light mode / dark mode within (#4736)
1 parent da90429 commit 85767e4

File tree

11 files changed

+147
-21
lines changed

11 files changed

+147
-21
lines changed

_static/custom.css

+9-9
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
--mobile-width-stop: 875;
55
}
66

7+
svg {
8+
max-width: 100%;
9+
height: auto;
10+
}
11+
712
.row-odd {
813
background-color: #f3f6f6;
914
}
@@ -373,11 +378,6 @@ div.sphinxsidebar input {
373378
margin-bottom: 1rem;
374379
}
375380

376-
377-
img.logo {
378-
content: url("/_static/logo-text-on-light.svg");
379-
}
380-
381381
@media screen and (max-width: 875px) {
382382
/* hide search result thumbnails on mobile */
383383
.pagefind-modular-list-thumb {
@@ -396,6 +396,10 @@ img.logo {
396396
/* dark theme */
397397
@media (prefers-color-scheme: dark) {
398398

399+
:root{
400+
--logo-text-color: #FFFFFF;
401+
}
402+
399403
.custom-footer{
400404
border-top: 1px solid #ececec;
401405
}
@@ -426,10 +430,6 @@ img.logo {
426430
background: #212121 !important;
427431
margin: 0 !important;
428432
}
429-
430-
img.logo {
431-
content: url("/_static/logo-text-on-dark.svg");
432-
}
433433

434434
img.dark-invert {
435435
filter: invert(1);

_templates/search.html

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<!-- docs/_templates/search.html -->
22
{% extends "page.html" %}
33

4+
45
{%- block htmltitle -%}
56
<title>{{ _("Search") }} - {{ docstitle }}</title>
67
{%- endblock htmltitle -%}

_templates/searchbox.html

+26
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1+
<svg xmlns="http://www.w3.org/2000/svg" width="1194" height="240" viewBox="0 0 1194 240">
2+
<defs>
3+
<style>
4+
.casita {
5+
fill: var(--logo-casita-color, #18BCF2);
6+
}
7+
.text{
8+
fill: var(--logo-text-color, #1D2126);
9+
}
10+
</style>
11+
</defs>
12+
<g class="casita">
13+
<path d="M240 219C240 227.24 233.24 234 225 234H15C6.76 234 0 227.24 0 219V129C0 120.76 4.78 109.22 10.6 103.4L109.4 4.61999C115.24 -1.22001 124.78 -1.22001 130.62 4.61999L229.4 103.4C235.24 109.24 240 120.76 240 129V219Z" />
14+
<path fill="#FFFFFF" d="M160 78.66H80C76.68 78.66 74 81.34 74 84.66V234H86V90.66H154V102.66H104C100.68 102.66 98 105.34 98 108.66V132.66C98 135.98 100.68 138.66 104 138.66H154V150.66H104C100.68 150.66 98 153.34 98 156.66V180.66C98 183.98 100.68 186.66 104 186.66H154V198.66H104C100.68 198.66 98 201.34 98 204.66C98 207.98 100.68 210.66 104 210.66H160C163.32 210.66 166 207.98 166 204.66V180.66C166 177.34 163.32 174.66 160 174.66H110V162.66H160C163.32 162.66 166 159.98 166 156.66V132.66C166 129.34 163.32 126.66 160 126.66H110V114.66H160C163.32 114.66 166 111.98 166 108.66V84.66C166 81.34 163.32 78.66 160 78.66Z" />
15+
</g>
16+
<g class="text">
17+
<path d="M423 167.61V190.11H336V49.95H423V72.63H359.82V108.91H416.26V130.01H359.82V167.61H423Z" />
18+
<path d="M491.08 47.41C503.9 47.41 514.54 50.53 523.04 56.79C531.54 63.03 536.76 71.39 538.7 81.83L516.3 87.93C515.04 81.93 512.12 77.31 507.54 74.05C502.94 70.81 497.28 69.17 490.52 69.17C483.26 69.17 477.52 70.91 473.28 74.37C469.02 77.83 466.9 82.45 466.9 88.19C466.9 97.25 472.52 103.13 483.78 105.81L506.66 111.53C518.48 114.59 527.32 119.45 533.2 126.11C539.08 132.77 542.02 140.97 542.02 150.71C542.02 163.21 537.48 173.31 528.42 181.03C519.36 188.75 507.24 192.61 492.04 192.61C478.36 192.61 466.78 189.39 457.36 182.95C448.04 176.27 442.54 167.45 440.86 156.51L463.26 150.69C464.08 156.87 467.16 161.73 472.5 165.23C477.84 168.73 484.64 170.47 492.9 170.47C501.16 170.47 507.08 168.79 511.6 165.45C516.14 162.11 518.4 157.57 518.4 151.81C518.4 142.81 512.78 136.87 501.52 133.99L478.64 128.45C466.88 125.77 458.06 120.99 452.16 114.15C446.26 107.31 443.3 98.95 443.3 89.07C443.3 76.69 447.7 66.65 456.48 58.93C465.26 51.21 476.8 47.35 491.12 47.35L491.08 47.41Z" />
19+
<path d="M666.1 95.61C666.1 109.37 661.92 120.49 653.58 128.99C645.24 137.49 634 141.75 619.88 141.75H588.38V190.13H564.56V49.95H620.06C634.3 49.95 645.54 54.07 653.76 62.27C661.98 70.49 666.08 81.59 666.08 95.59L666.1 95.61ZM641.16 95.05C641.16 87.99 638.96 82.25 634.56 77.85C630.16 73.45 623.92 71.25 615.86 71.25H588.4V120.85H615.5C623.74 120.85 630.1 118.51 634.54 113.81C638.98 109.13 641.2 102.87 641.2 95.05H641.16Z" />
20+
<path d="M687.38 49.95H711.2V108.55L772.98 108.73V49.95H796.98V190.11H772.98V129.83L711.2 129.65V190.11H687.38V49.95Z" />
21+
<path d="M868.6 92.79C883.1 92.79 894.92 97.45 904.04 106.75C913.16 116.07 917.72 128.03 917.72 142.65C917.72 157.27 913.16 169.15 904.04 178.47C894.92 187.79 883.1 192.43 868.6 192.43C854.1 192.43 842.1 187.77 832.98 178.47C823.86 169.15 819.3 157.23 819.3 142.65C819.3 128.07 823.86 115.97 832.98 106.69C842.1 97.41 853.98 92.77 868.6 92.77V92.79ZM868.6 172.01C876.34 172.01 882.64 169.27 887.5 163.81C892.34 158.35 894.76 151.23 894.76 142.49C894.76 133.75 892.34 126.67 887.5 121.25C882.66 115.85 876.36 113.15 868.6 113.15C860.84 113.15 854.26 115.85 849.38 121.25C844.5 126.65 842.06 133.73 842.06 142.49C842.06 151.25 844.5 158.35 849.38 163.81C854.26 169.27 860.66 172.01 868.6 172.01Z" />
22+
<path d="M1081.6 129.83V190.11H1059.56V133.29C1059.56 126.73 1057.88 121.61 1054.5 117.91C1051.12 114.23 1046.54 112.37 1040.72 112.37C1034.54 112.37 1029.6 114.39 1025.9 118.41C1022.22 122.45 1020.36 128.09 1020.36 135.33V190.09H998.04V133.27C998.04 126.71 996.4 121.59 993.12 117.89C989.84 114.21 985.3 112.35 979.48 112.35C973.3 112.35 968.32 114.37 964.58 118.39C960.84 122.41 958.96 128.07 958.96 135.31V190.07H936.28V95.39H957.38L958.14 104.49C963.64 96.43 972.6 92.39 985.04 92.39C992.28 92.39 998.58 93.89 1003.88 96.89C1009.2 99.89 1013.22 104.27 1015.98 110.01C1018.3 104.51 1022.12 100.19 1027.46 97.07C1032.8 93.95 1039.16 92.39 1046.54 92.39C1057.28 92.39 1065.82 95.71 1072.14 102.33C1078.46 108.95 1081.6 118.11 1081.6 129.79V129.83Z" />
23+
<path d="M1193.54 151.11H1120.98C1121.74 158.23 1124.42 163.67 1129.04 167.43C1133.66 171.19 1139.54 173.05 1146.66 173.05C1158.22 173.05 1166.32 168.23 1170.94 158.61L1189.88 166.11C1186.32 174.43 1180.7 180.93 1173.06 185.61C1165.4 190.29 1156.6 192.65 1146.66 192.65C1132.66 192.65 1121.3 188.07 1112.58 178.91C1103.86 169.75 1099.5 157.73 1099.5 142.87C1099.5 128.01 1103.9 115.91 1112.68 106.59C1121.46 97.27 1132.94 92.63 1147.14 92.63C1161.34 92.63 1172.3 97.23 1180.8 106.41C1189.3 115.59 1193.56 127.69 1193.56 142.69V151.13L1193.54 151.11ZM1121.36 135.17H1170.48C1170.04 127.49 1167.72 121.63 1163.5 117.59C1159.28 113.55 1153.6 111.55 1146.48 111.55C1139.36 111.55 1133.66 113.59 1129.24 117.69C1124.8 121.79 1122.18 127.61 1121.36 135.17Z" />
24+
</g>
25+
</svg>
26+
127
<script src="/pagefind/pagefind-modular-ui.js"></script>
228
<div class="pagefind-ui__form" id="search"></div>
329
<script>

components/index.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
:description: ESPHome main documentation
55
:image: logo-docs.svg
66

7-
.. image:: /images/logo-docs.svg
7+
.. raw:: html
8+
:file: ../images/logo-docs.svg
89

910
This page is an index of all of the hardware components and platforms ESPHome currently supports.
1011

conf.py

-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@
145145
"custom_css_hash": custom_css_hash,
146146
}
147147

148-
html_logo = "images/logo-text.svg"
149148
html_copy_source = True
150149
html_show_sourcelink = False
151150
html_last_updated_fmt = None

guides/contributing.rst

+2-4
Original file line numberDiff line numberDiff line change
@@ -831,10 +831,8 @@ Note that you can use this procedure for other branches, too, such as ``next`` o
831831
Contributing to ESPHome
832832
-----------------------
833833

834-
.. image:: /images/logo-text.svg
835-
:align: center
836-
:width: 60.0%
837-
:class: dark-invert
834+
.. raw:: html
835+
:file: ../images/logo-text.svg
838836

839837
This is a guide to contributing to the ESPHome codebase. ESPHome uses two languages for its project: Python and C++.
840838

images/index.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ that will only be used in raw HTML and thus not auto-included.
1010

1111
.. image:: logo-docs.svg
1212

13-
.. image:: logo-text.svg
13+
.. raw:: html
14+
:file: ../images/logo-text.svg

0 commit comments

Comments
 (0)