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

Forces sidebar search to hide on desktop but show on mobile, when enabled #297

Merged
merged 3 commits into from
Jul 1, 2020
Merged

Forces sidebar search to hide on desktop but show on mobile, when enabled #297

merged 3 commits into from
Jul 1, 2020

Conversation

mgibson323
Copy link
Contributor

I am using the Docsy theme on a project for work. Our goal was to have search enabled but only have 1 search box displayed at a time. This can be accomplished by hiding the sidebar search in config.toml, but this also hides it for mobile users. This creates a problem since the search box on the main menu at the top of the page is hidden on mobile.

To fix this, I modified assets/scss/_sidebar-tree.scss and layouts/partials/sidebar-tree.html. The changes are trivial, but now the sidebar search box is hidden on desktop and shows on mobile - when it's enabled in config.toml.

There may be a better or more elegant way to do this so please feel free to implement it in whatever way makes sense for the project.

Thanks!

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@mgibson323
Copy link
Contributor Author

@googlebot I signed it!

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@LisaFC
Copy link
Collaborator

LisaFC commented Jun 29, 2020

This looks really helpful, I'll take a proper look at how you've implemented it before I comment/merge but it seems like it should really help our mobile users.

@LisaFC
Copy link
Collaborator

LisaFC commented Jun 29, 2020

Also should fix #211

assets/scss/_sidebar-tree.scss Outdated Show resolved Hide resolved
layouts/partials/sidebar-tree.html Outdated Show resolved Hide resolved
@mgibson323 mgibson323 requested a review from LisaFC June 30, 2020 20:49
@LisaFC
Copy link
Collaborator

LisaFC commented Jul 1, 2020

Thanks!!

@LisaFC LisaFC merged commit 3587df0 into google:master Jul 1, 2020
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.

3 participants