File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
pep_sphinx_extensions/pep_theme Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change 17
17
nav # pep-sidebar {
18
18
display : none;
19
19
}
20
+ /* Show mobile search container on small screens */
21
+ .mobile-search-container {
22
+ display : block;
23
+ }
20
24
pre {
21
25
font-size : 0.8175rem ;
22
26
}
46
50
float : left;
47
51
margin-right : 2% ;
48
52
}
53
+ /* Hide mobile search container on larger screens */
54
+ .mobile-search-container {
55
+ display : none;
56
+ }
49
57
/* Make less prominent when sidebar ToC is available */
50
58
details > summary {
51
59
font-size : 1rem ;
Original file line number Diff line number Diff line change @@ -46,6 +46,8 @@ <h1>Python Enhancement Proposals</h1>
46
46
< span class ="visually-hidden "> Toggle light / dark / auto colour theme</ span >
47
47
</ button >
48
48
</ header >
49
+ {# Mobile search box - visible only on small screens #}
50
+ < div id ="mobile-search " class ="mobile-search-container "> </ div >
49
51
< article data-pagefind-body >
50
52
{# Add pagefind meta for the title to improve search result display #}
51
53
< div data-pagefind-meta ="title:{{ title }} " style ="display:none; "> </ div >
@@ -73,6 +75,12 @@ <h2>Contents</h2>
73
75
window . addEventListener ( 'DOMContentLoaded' , ( event ) => {
74
76
// Initialize pagefind for desktop sidebar
75
77
new PagefindUI ( { element : "#search" , showSubResults : true } ) ;
78
+
79
+ // Initialize pagefind for mobile view
80
+ const mobileSearch = document . getElementById ( 'mobile-search' ) ;
81
+ if ( mobileSearch && window . innerWidth <= 640 ) {
82
+ new PagefindUI ( { element : "#mobile-search" , showSubResults : false } ) ;
83
+ }
76
84
} ) ;
77
85
</ script >
78
86
</ body >
You can’t perform that action at this time.
0 commit comments