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

Show the search button in narrow view #2335

Closed
olivroy opened this issue Aug 16, 2023 · 5 comments
Closed

Show the search button in narrow view #2335

olivroy opened this issue Aug 16, 2023 · 5 comments
Labels
feature a feature request or enhancement front end 🌷 General HTML, CSS, and JS issues

Comments

@olivroy
Copy link
Collaborator

olivroy commented Aug 16, 2023

image

When in narrow view, we only see the Content button on the right and the package name.

Imo, there would be plenty of space to at least show the search button there?

Suggestion:
image
(sorry for my bad drawing)

@hadley hadley added feature a feature request or enhancement front end 🌷 General HTML, CSS, and JS issues labels Oct 30, 2023
@hadley
Copy link
Member

hadley commented Apr 12, 2024

Would you be willing to have a go at this? I think the basic idea is into bs5/templates/navbar.html to move:

      <form class="form-inline my-2 my-lg-0" role="search">
        <input type="search" class="form-control me-sm-2" aria-label="{{#translate}}{{toggle_nav}}{{/translate}}" name="search-input" data-search-index="{{#site}}{{root}}{{/site}}search.json" id="search-input" placeholder="{{#translate}}{{search_for}}{{/translate}}" autocomplete="off">
      </form>

outside of the div with class="collapse navbar-collapse ms-3", and then mess around with the margin classes (me-, my- etc) to make it look good.

The docs for the collapsing behaviour are at https://getbootstrap.com/docs/5.3/components/navbar/#responsive-behaviors, and the docs for the margin utility classes are at https://getbootstrap.com/docs/5.3/utilities/spacing/.

I don't think I am particularly skilled at this sort of task; I don't understand bootstrap enough to accurately predict what changes I need to make, so I just do a lot of guess and checking 😄.

@hadley hadley changed the title FR: show the search button in narrow view Show the search button in narrow view Apr 12, 2024
@olivroy
Copy link
Collaborator Author

olivroy commented Apr 14, 2024

I will keep trying to look into it.

Quarto does this by default..

http://www.cranhaven.org/
image

@hadley
Copy link
Member

hadley commented Apr 18, 2024

Hmmm, this might be in direct conflict with #2449, since search is no longer special cased.

@olivroy
Copy link
Collaborator Author

olivroy commented Apr 18, 2024

You are right! I generally like how Quarto does things. (doesn't seem possible to select search position exactly, just navbar or sidebar is available) https://quarto.org/docs/websites/website-search.html#search-appearance

@hadley
Copy link
Member

hadley commented Apr 19, 2024

I've decided that this probably isn't going to be possible in pkgdown, because we can't just have an icon like quarto, because our search works differently. I think that means it'll generally make the mobile navbar, especially for packages with longer names.

@hadley hadley closed this as completed Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement front end 🌷 General HTML, CSS, and JS issues
Projects
None yet
Development

No branches or pull requests

2 participants