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

fix(theme): set search box min-width for >=751px #286

Merged
merged 2 commits into from
May 27, 2021
Merged

fix(theme): set search box min-width for >=751px #286

merged 2 commits into from
May 27, 2021

Conversation

dnischeta
Copy link
Contributor

Description

This PR closes #250.

Solution

min-width: 176,3px was moved to @media (min-width: 751px) { ... } block (as @nico-bachner suggested in issue).

Result

  • 751px
    751
  • 750px
    750
  • 720px
    720

@dnischeta
Copy link
Contributor Author

dnischeta commented Apr 16, 2021

Maybe it is worth to remove padding-left: 8px from @media (min-width: 751px) { ... } rules block. This rule is already set in @media (min-width: 720px) { ... } block.

@media (min-width: 720px) {
  .algolia-search-box {
    padding-left: 8px;
  }
}
@media (min-width: 751px) {
  .algolia-search-box {
    min-width: 176.3px; /* avoid layout shift */
    padding-left: 8px;
  }
  .algolia-search-box .DocSearch-Button-Placeholder {
    padding-left: 8px;
    font-size: 0.9rem;
    font-weight: 500;
  }
}

@nico-bachner
Copy link
Contributor

Nice. Looks good.

To me it seems that

@media (min-width: 751px) {
  .algolia-search-box {
    padding-left: 8px;
  }
}

is indeed superfluous as you say. Not sure if I'm missing anything though.

@dnischeta
Copy link
Contributor Author

I removed rule repeat with last commit.

@antfu antfu merged commit 9589a5d into vuejs:master May 27, 2021
YunYouJun pushed a commit to YunYouJun/vitepress that referenced this pull request Aug 30, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Algolia search field collapse behaviour
3 participants