-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PyData Sphinx theme: DocSearch not showing on narrow screens #35
Comments
For those looking for a workaround or two: based on the PyData Sphinx Theme documentation, the div/template can be added under the navigation bar ( |
This is not working for me (unless I'm mistaken). |
Oops, thanks, @Charlie-XIAO – I did mean to mention |
I can repro this issue on sphinx-book-theme |
This scss worked for me on /* -- General .search-button-field fixes for sphinx-book-theme workarounds -------- */
.sidebar-primary-item {
/* Fix theme search button field for narrow screens */
.search-button-field {
display: flex; /* Align children horizontally */
justify-content: space-between; /* Space between icon, text, and shortcut */
align-items: center; /* Vertically */
width: 100%; /* Ensure it spans the full width; TODO: necessary? */
/* Undo the display:none and text oddities for narrow screens */
.search-button__default-text {
display: unset;
flex-grow: 1; /* Allow text to take up the remaining space */
text-align: left;
font-size: 14px;
}
/* CTRL+K text is hidden on narrow screens */
.search-button__kbd-shortcut {
display: unset;
}
}
} |
Split off from issue #33.
The Pydata Sphinx theme includes the searchbox twice (you can specify the template with
html_theme_options.navbar_persistent
). Once for wider screens and once for narrower screens.The DocSearch UI can only be added once per page, so it's added to the element for wider screens only. This means the search is not available on narrower screens.
The text was updated successfully, but these errors were encountered: