-
Notifications
You must be signed in to change notification settings - Fork 339
ENH: Search button shows up on mobile #832
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changes make sense, and it works as expected on the PR site build. Nice! Just one question and one "remove crufty comments" request :)
|
||
<div class="search-button__wrapper"> | ||
<div class="search-button__overlay"></div> | ||
<div class="search-button__search-container"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
previously this was {{ containerClass }}
, I'm having trouble figuring out the reasons / implications of hard-coding it instead. Is it easy for you to explain?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the main reason I removed it is because it only seemed to be used in a single place in all of the theme, so I suspect in a previous iteration we had used it in multiple places, but then had removed one of those places. If we're only using it once, and if we were hard-coding it as a variable, I figured it'd be simpler to just remove the variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense, thanks!
@@ -1,14 +1,5 @@ | |||
{# Search page has its own UI / UX for search #} | |||
<!-- A button that will trigger a search field to be displayed on click. --> | |||
{% set containerClass="search-button__search-container" %} | |||
|
|||
<!-- An overlay that will expand in the background and cause the search to disappear when clicked --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this comment, and the comment on line 1, both seem outdated / irrelevant now: the overlay was removed from this file, and the fact that the search page has its own UI for search matters, but doesn't matter here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comments removed! good catch
Cool better experience for the user. Do I understand correctly that on mobile the design is fixed and not controlled anymore by what you put in |
Yep, right now it's hard-coded to show up on mobile. I didn't think it was likely that somebody really wouldn't want a search button to show up, but if we get requests like this we can add in functionality to do so in the future. In general, I'd rather we start with fewer knobs to turn, and then add them iteratively only when we know people want them :-) |
I'm going to merge this one in so that we can iterate in #834 |
This PR makes our search button show up in header when on mobile. This means users can click to search with one click from any page on our documentation.
To accomplish this, I had to slightly re-work how the search implementation works. Here's a quick summary:
navbar_center
section (which will only show up on narrow screens)header
and is now alongside our other overlays (for sidebars)display: none
Closes #824