Skip to content
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

Use a magnifying glass instead of a text "Go" for the search button #12590

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

timhoffm
Copy link
Contributor

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.

Preview:
grafik

@chrisjsewell
Copy link
Member

I would just give some a little more left-padding to the text input cheers

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.
@timhoffm
Copy link
Contributor Author

Whoops. Yes, the padding got lost. Fixed:
grafik

@picnixz
Copy link
Member

picnixz commented Jul 16, 2024

Not sure if it's me but... could you vertically center the glass?

@chrisjsewell
Copy link
Member

Not sure if it's me but... could you vertically center the glass?

Yeh actually I see that now also 😅

@timhoffm
Copy link
Contributor Author

timhoffm commented Jul 16, 2024

The text is centered. If I double the height, I get

image

I believe this is an effect how the font renders the glyph: On another system (windows), I get:
image

While one could add padding to shift it for a specific font, that might make it worse for other font. I believe one has to live with this. Or do you have an idea?

Edit: I believe we don't want to add fontawesome or some web fonts. One solution might be to embed a svg icon (e.g. https://uxwing.com/search-icon/) but I'm not a HTML expert, so not sure if/how that works.

@timhoffm
Copy link
Contributor Author

timhoffm commented Jul 16, 2024

I don't believe it is feasible to add an SVG icon to the submit button as is. I therefore propose to close because we cannot guarantee reasonable positioning with unicode glyphs.

An alternative route would be an adaption of https://pagedart.com/blog/how-to-add-a-search-bar-in-html/, which for example could be styled like this:

grafik

Or, how Furo, where the looking glass is only decoration and you don't have any button (submit only by enter)
grafik

The downside is that this uses other html elements and styling (border runs around the complete form not only the input box, the looking glass is actually the button). Thus customization of downstream themes would be broken. - Likely their CSS just does not have any effect and they would get the default styling we provide. Would that be acceptable?

@AA-Turner AA-Turner added this to the 8.0.0 milestone Jul 20, 2024
@AA-Turner AA-Turner modified the milestones: 8.0.0, 8.x Jul 23, 2024
@AA-Turner
Copy link
Member

This is not a release blocker.

@jayaddison jayaddison added type:proposal a feature suggestion html search labels Jul 23, 2024
@timhoffm timhoffm marked this pull request as draft July 26, 2024 01:35
@timhoffm
Copy link
Contributor Author

Moving to draft until a decision is reached on #12590 (comment)

@AA-Turner AA-Turner modified the milestones: 8.x, some future version Jan 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
html search type:proposal a feature suggestion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants