Skip to content

Commit

Permalink
Use a magnifying glass instead of a text "Go" for the search button
Browse files Browse the repository at this point in the history
additionally:
- Change placeholder text from "Search" to "Search...", which seems more common
- CSS changes: Use a fixed height to make sure search field and button have the
  same hight. Also reduce button width a little because the icon needs less
  space.
  • Loading branch information
timhoffm committed Jul 15, 2024
1 parent 1e13565 commit 25a7275
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion sphinx/themes/basic/searchbox.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ <h3 id="searchlabel">{{ _('Quick search') }}</h3>
<div class="searchformwrapper">
<form class="search" action="{{ pathto('search') }}" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="{{ _('Go') }}" />
<input type="submit" value="{{ _('🔍') }}" />
</form>
</div>
</search>
Expand Down
4 changes: 2 additions & 2 deletions sphinx/themes/basic/searchfield.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
<search id="searchbox" style="display: none" role="search">
<div class="searchformwrapper">
<form class="search" action="{{ pathto('search') }}" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" placeholder="Search"/>
<input type="submit" value="{{ _('Go') }}" />
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" placeholder="Search..."/>
<input type="submit" value="{{ _('🔍︎') }}" />
</form>
</div>
</search>
Expand Down
9 changes: 5 additions & 4 deletions sphinx/themes/basic/static/basic.css.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,17 @@ div.sphinxsidebar #searchbox form.search {

div.sphinxsidebar #searchbox input[type="text"] {
float: left;
width: 80%;
padding: 0.25em;
width: 84%;
height: 2em;
padding-left: 0.4em;
box-sizing: border-box;
}

div.sphinxsidebar #searchbox input[type="submit"] {
float: left;
width: 20%;
width: 16%;
height: 2em;
border-left: none;
padding: 0.25em;
box-sizing: border-box;
}

Expand Down

0 comments on commit 25a7275

Please sign in to comment.