@@ -37,7 +37,7 @@ <h3>{{ _('Navigation') }}</h3>
3737 {{ reldelim2 }}
3838 </ li >
3939 {%- endif %}
40- < li class ="right "> < input type =" button " value =" Toggle theme " class =" theme-toggle " onclick =" toggleTheme() " > {{ reldelim2 }}</ li >
40+ < li class ="right "> {{ themeselector() }} {{ reldelim2 }}</ li >
4141 {% endblock %}
4242 </ ul >
4343 </ div >
@@ -57,6 +57,17 @@ <h3>{{ _('Navigation') }}</h3>
5757 {%- endif %}
5858{%- endmacro %}
5959
60+ {%- macro themeselector() %}
61+ < label class ="theme-selector-label ">
62+ {{ _('Color theme') }}
63+ < select class ="theme-selector " oninput ="activateTheme(this.value) ">
64+ < option value ="auto " selected > {{ _('Auto (default)') }}</ option >
65+ < option value ="light "> {{ _('Light theme') }}</ option >
66+ < option value ="dark "> {{ _('Dark theme') }}</ option >
67+ </ select >
68+ </ label >
69+ {%- endmacro %}
70+
6071{% block relbar1 %} {% if builder != 'qthelp' %} {{ relbar() }} {% endif %} {% endblock %}
6172{% block relbar2 %} {% if builder != 'qthelp' %} {{ relbar() }} {% endif %} {% endblock %}
6273
@@ -84,28 +95,31 @@ <h3>{{ _('Navigation') }}</h3>
8495< div class ="mobile-nav ">
8596 < input type ="checkbox " id ="menuToggler " class ="toggler__input " aria-controls ="navigation "
8697 aria-pressed ="false " aria-expanded ="false " role ="button " aria-label ="{{ _('Menu')}} " />
87- < label for ="menuToggler " class ="toggler__label ">
88- < span > </ span >
89- </ label >
9098 < nav class ="nav-content " role ="navigation ">
91- < a href ="{{ theme_root_url }} " class ="nav-logo ">
92- < img src ="{{ pathto('_static/py.svg', 1) }} " alt ="Logo "/>
93- </ a >
94- < div class ="version_switcher_placeholder "> </ div >
95- {%- if pagename != "search" and builder != "singlehtml" %}
96- < form role ="search " class ="search " action ="{{ pathto('search') }} " method ="get ">
97- < svg xmlns ="http://www.w3.org/2000/svg " width ="20 " height ="20 " viewBox ="0 0 24 24 " class ="search-icon ">
98- < path fill-rule ="nonzero "
99- d ="M15.5 14h-.79l-.28-.27a6.5 6.5 0 001.48-5.34c-.47-2.78-2.79-5-5.59-5.34a6.505 6.505 0 00-7.27 7.27c.34 2.8 2.56 5.12 5.34 5.59a6.5 6.5 0 005.34-1.48l.27.28v.79l4.25 4.25c.41.41 1.08.41 1.49 0 .41-.41.41-1.08 0-1.49L15.5 14zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z " fill ="#444 "> </ path >
100- </ svg >
101- < input type ="text " name ="q " aria-label ="{{ _('Quick search') }} "/>
102- < input type ="submit " value ="{{ _('Go') }} "/>
103- </ form >
104- {%- endif %}
99+ < label for ="menuToggler " class ="toggler__label ">
100+ < span > </ span >
101+ </ label >
102+ < span class ="nav-items-wrapper ">
103+ < a href ="{{ theme_root_url }} " class ="nav-logo ">
104+ < img src ="{{ pathto('_static/py.svg', 1) }} " alt ="Logo "/>
105+ </ a >
106+ < span class ="version_switcher_placeholder "> </ span >
107+ {%- if pagename != "search" and builder != "singlehtml" %}
108+ < form id ="searchbox " role ="search " class ="search " action ="{{ pathto('search') }} " method ="get ">
109+ < svg xmlns ="http://www.w3.org/2000/svg " width ="20 " height ="20 " viewBox ="0 0 24 24 " class ="search-icon ">
110+ < path fill-rule ="nonzero " fill ="currentColor " d ="M15.5 14h-.79l-.28-.27a6.5 6.5 0 001.48-5.34c-.47-2.78-2.79-5-5.59-5.34a6.505 6.505 0 00-7.27 7.27c.34 2.8 2.56 5.12 5.34 5.59a6.5 6.5 0 005.34-1.48l.27.28v.79l4.25 4.25c.41.41 1.08.41 1.49 0 .41-.41.41-1.08 0-1.49L15.5 14zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z "> </ path >
111+ </ svg >
112+ < input type ="search " name ="q " aria-label ="{{ _('Quick search') }} "/>
113+ < input type ="submit " value ="{{ _('Go') }} "/>
114+ {# TODO missing hidden inputs #}
115+ </ form >
116+ {%- endif %}
117+ </ span >
105118 </ nav >
106119 < div class ="menu-wrapper ">
107120 < nav class ="menu " role ="navigation " aria-label ="main navigation ">
108121 < div class ="language_switcher_placeholder "> </ div >
122+ {{ themeselector() }}
109123 {%- if logo %}
110124 < p class ="logo ">
111125 < a href ="{{ pathto('index') }} ">
0 commit comments