Skip to content

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

Merged
LisaFC merged 3 commits intogoogle:masterfrom
mgibson323:master
Jul 1, 2020
Merged

Forces sidebar search to hide on desktop but show on mobile, when enabled#297
LisaFC merged 3 commits intogoogle:masterfrom
mgibson323:master

Conversation

@mgibson323
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
Contributor Author

@googlebot I signed it!

@googlebot
Copy link
Copy Markdown

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@LisaFC
Copy link
Copy Markdown
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
Copy Markdown
Collaborator

LisaFC commented Jun 29, 2020

Also should fix #211

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

LisaFC commented Jul 1, 2020

Thanks!!

@LisaFC LisaFC merged commit 3587df0 into google:master Jul 1, 2020
Challenge-Cyber pushed a commit to Challenge-Cyber/sok that referenced this pull request Sep 30, 2025
Challenge-Cyber pushed a commit to Challenge-Cyber/sok that referenced this pull request Sep 30, 2025
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