Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENH: Add search button that looks like field (#1233)
* ENH: Add search button that looks like field * refactor: make the button field the default search * fstyle: resize search-field-button * style: use same class for ctrl and k * reroll package-lock.json * align package and pakage-lock on main * Restore package.json * restore package-lock.json * Fix search field button padding on mobile screens --------- Co-authored-by: Rambaud Pierrick <12rambau@users.noreply.github.com> Co-authored-by: Pierrick Rambaud <pierrick.rambaud49@gmail.com>
- Loading branch information
1 parent
bc82874
commit eb8bdee
Showing
3 changed files
with
54 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/pydata_sphinx_theme/theme/pydata_sphinx_theme/components/search-button-field.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{# Behaves the same as `search-button.html` but looks more like a search field. | ||
# | ||
# As this function will only work when JavaScript is enabled, we add it through JavaScript. | ||
#} | ||
<script> | ||
document.write(` | ||
<button class="btn navbar-btn search-button-field search-button__button" title="{{ _('Search') }}" aria-label="{{ _('Search') }}" data-bs-placement="bottom" data-bs-toggle="tooltip"> | ||
<i class="fa-solid fa-magnifying-glass"></i> | ||
<span class="search-button__kbd-shortcut">{{ _('Search') }}</span> | ||
<span><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd class="kbd-shortcut__modifier">K</kbd></span> | ||
</button> | ||
`); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters