@@ -37,6 +37,7 @@ <h3>{{ _('Navigation') }}</h3>
37
37
{{ reldelim2 }}
38
38
</ li >
39
39
{%- endif %}
40
+ < li class ="right "> {{ themeselector() }}{{ reldelim2 }}</ li >
40
41
{% endblock %}
41
42
</ ul >
42
43
</ div >
@@ -47,25 +48,35 @@ <h3>{{ _('Navigation') }}</h3>
47
48
{%- if builder != "htmlhelp" %}
48
49
< div class ="inline-search " role ="search ">
49
50
< form class ="inline-search " action ="{{ pathto('search') }} " method ="get ">
50
- < input placeholder ="{{ _('Quick search') }} " aria-label ="{{ _('Quick search') }} " type ="text " name ="q " />
51
+ < input placeholder ="{{ _('Quick search') }} " aria-label ="{{ _('Quick search') }} " type ="search " name ="q " />
51
52
< input type ="submit " value ="{{ _('Go') }} " />
52
- < input type ="hidden " name ="check_keywords " value ="yes " />
53
- < input type ="hidden " name ="area " value ="default " />
54
53
</ form >
55
54
</ div >
56
55
{%- endif %}
57
56
{%- endmacro %}
58
57
58
+ {%- macro themeselector() %}
59
+ < label class ="theme-selector-label ">
60
+ {{ _('Theme') }}
61
+ < select class ="theme-selector " oninput ="activateTheme(this.value) ">
62
+ < option value ="auto " selected > {{ _('Auto') }}</ option >
63
+ < option value ="light "> {{ _('Light') }}</ option >
64
+ < option value ="dark "> {{ _('Dark') }}</ option >
65
+ </ select >
66
+ </ label >
67
+ {%- endmacro %}
68
+
59
69
{% block relbar1 %} {% if builder != 'qthelp' %} {{ relbar() }} {% endif %} {% endblock %}
60
70
{% block relbar2 %} {% if builder != 'qthelp' %} {{ relbar() }} {% endif %} {% endblock %}
61
71
62
-
63
72
{%- block extrahead -%}
73
+ < link rel ="stylesheet " href ="{{ pathto('_static/pydoctheme_dark.css', 1) }} " media ="(prefers-color-scheme: dark) " id ="pydoctheme_dark_css ">
64
74
< link rel ="shortcut icon " type ="image/png " href ="{{ pathto('_static/' + theme_root_icon, 1) }} " />
65
75
{%- if builder != "htmlhelp" %}
66
76
{%- if not embedded %}
67
77
< script type ="text/javascript " src ="{{ pathto('_static/copybutton.js', 1) }} "> </ script >
68
78
< script type ="text/javascript " src ="{{ pathto('_static/menu.js', 1) }} "> </ script >
79
+ < script type ="text/javascript " src ="{{ pathto('_static/themetoggle.js', 1) }} "> </ script >
69
80
{%- endif -%}
70
81
{%- endif -%}
71
82
{{ super() }}
@@ -82,28 +93,30 @@ <h3>{{ _('Navigation') }}</h3>
82
93
< div class ="mobile-nav ">
83
94
< input type ="checkbox " id ="menuToggler " class ="toggler__input " aria-controls ="navigation "
84
95
aria-pressed ="false " aria-expanded ="false " role ="button " aria-label ="{{ _('Menu')}} " />
85
- < label for ="menuToggler " class ="toggler__label ">
86
- < span > </ span >
87
- </ label >
88
96
< nav class ="nav-content " role ="navigation ">
89
- < a href ="{{ theme_root_url }} " class ="nav-logo ">
90
- < img src ="{{ pathto('_static/py.svg', 1) }} " alt ="Logo "/>
91
- </ a >
92
- < div class ="version_switcher_placeholder "> </ div >
93
- {%- if pagename != "search" and builder != "singlehtml" %}
94
- < form role ="search " class ="search " action ="{{ pathto('search') }} " method ="get ">
95
- < svg xmlns ="http://www.w3.org/2000/svg " width ="20 " height ="20 " viewBox ="0 0 24 24 " class ="search-icon ">
96
- < path fill-rule ="nonzero "
97
- 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 >
98
- </ svg >
99
- < input type ="text " name ="q " aria-label ="{{ _('Quick search') }} "/>
100
- < input type ="submit " value ="{{ _('Go') }} "/>
101
- </ form >
102
- {%- endif %}
97
+ < label for ="menuToggler " class ="toggler__label ">
98
+ < span > </ span >
99
+ </ label >
100
+ < span class ="nav-items-wrapper ">
101
+ < a href ="{{ theme_root_url }} " class ="nav-logo ">
102
+ < img src ="{{ pathto('_static/py.svg', 1) }} " alt ="Logo "/>
103
+ </ a >
104
+ < span class ="version_switcher_placeholder "> </ span >
105
+ {%- if pagename != "search" and builder != "singlehtml" %}
106
+ < form id ="searchbox " role ="search " class ="search " action ="{{ pathto('search') }} " method ="get ">
107
+ < svg xmlns ="http://www.w3.org/2000/svg " width ="20 " height ="20 " viewBox ="0 0 24 24 " class ="search-icon ">
108
+ < 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 >
109
+ </ svg >
110
+ < input placeholder ="{{ _('Quick search') }} " aria-label ="{{ _('Quick search') }} " type ="search " name ="q " />
111
+ < input type ="submit " value ="{{ _('Go') }} "/>
112
+ </ form >
113
+ {%- endif %}
114
+ </ span >
103
115
</ nav >
104
116
< div class ="menu-wrapper ">
105
117
< nav class ="menu " role ="navigation " aria-label ="main navigation ">
106
118
< div class ="language_switcher_placeholder "> </ div >
119
+ {{ themeselector() }}
107
120
{%- if logo %}
108
121
< p class ="logo ">
109
122
< a href ="{{ pathto('index') }} ">
0 commit comments