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

feat(autocomplete-theme-classic): align search box properly #511

Merged
merged 3 commits into from
Apr 8, 2021

Conversation

sarahdayan
Copy link
Member

This tweaks the styles so that the search box visually aligns on other elements. This applies to the loading indicator too, and optimizes for the largest possible clickable/tappable area on the submit and clear buttons.

Desktop

Capture d’écran 2021-04-01 à 19 41 08 (2)

Capture d’écran 2021-04-01 à 19 41 20 (2)

Capture d’écran 2021-04-01 à 19 41 24 (2)

Mobile

Capture d’écran 2021-04-01 à 20 36 50

Capture d’écran 2021-04-01 à 20 37 00 (2)

Capture d’écran 2021-04-01 à 20 37 07 (2)

On mobile, the submit icon has to be close to the left edge to align with the icons below. I didn't replicate this exact gap between the clear button and the right edge, because it looked weird. I've tried to find a gap that felt right instead. It looks a bit odd when looking at it on a computer screen, but feels smooth on a mobile device.

I've tried to simplify the calc statements as much as possible so they don't wrap and are easier to read. Whenever a factor or divisor doesn't equal to a fixed decimal value, I used fractions to avoid losing precision.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Apr 1, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit a7f2c9d:

Sandbox Source
@algolia/autocomplete-example-github-repositories-custom-plugin Configuration
@algolia/autocomplete-example-playground Configuration
@algolia/autocomplete-example-query-suggestion-with-categories Configuration
@algolia/autocomplete-example-query-suggestions-with-hits Configuration
@algolia/autocomplete-example-query-suggestions-with-inline-categories Configuration
@algolia/autocomplete-example-query-suggestions-with-recent-searches Configuration
@algolia/autocomplete-example-query-suggestions Configuration
@algolia/autocomplete-example-react-renderer Configuration
@algolia/autocomplete-example-recently-viewed-items Configuration

@Shipow
Copy link
Contributor

Shipow commented Apr 6, 2021

looks good!
did you play with the spacing css var ?

Copy link
Contributor

@Haroenv Haroenv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks 🔥

Copy link
Member

@francoischalifour francoischalifour left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dope!

@sarahdayan
Copy link
Member Author

@Shipow Good catch, I didn't. Once we merge I'll try to see how it plays out.

@sarahdayan sarahdayan requested review from Shipow and removed request for Shipow April 7, 2021 09:14
* fix(examples): fix GitHub example layout

* fix: apply suggestions from code review

Co-authored-by: Clément Vannicatte <20689156+shortcuts@users.noreply.github.com>

Co-authored-by: Clément Vannicatte <20689156+shortcuts@users.noreply.github.com>
@Shipow
Copy link
Contributor

Shipow commented Apr 8, 2021

image
I feel maybe we should try to reduce the spacing between search icon and query when on mobile (and so the rest of the alignement).

@sarahdayan
Copy link
Member Author

@Shipow That makes sense indeed. Let's do this in another PR.

@sarahdayan sarahdayan merged commit c807ed4 into next Apr 8, 2021
@sarahdayan sarahdayan deleted the feat/theme-search-box branch April 8, 2021 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants