-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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: adjust spacing for custom search properly #7164
Conversation
✅ [V2]
To edit notification comments on pull requests, go to your Netlify site settings. |
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-7164--docusaurus-2.netlify.app/ |
Size Change: +194 B (0%) Total Size: 797 kB
ℹ️ View Unchanged
|
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.
I think this won't work as soon as we use the Nvm, looked at it again, search items are respected as well, but the point below still standstype: "search"
navbar item, right?
IMO the goal is to reduce coupling between navbar items and navbar layout instead of hardcoding more special items, because it's in our plan to make every navbar item configurable (see also #7154 for one such confusion)
What about unifying the padding/margin for every navbar item? We have a similar problem for the color mode toggle as well.
Since SeachBar implementation comes from third-party plugins, we need put it in wrapper to set proper spacing by analogy with other navbar items. I don't know any other way to achieve this without introducing extra component. |
Oh, I see where you are coming from. Can this wrapper be made generic? e.g. a |
No, because the search bar requires extra wrapper, not only to adjust the spacing, but to proper positioning on mobiles (see styles.css file). |
👍 looks like a useful extra wrapper Agree we can still improve things more and having something like |
I totally understand the extra wrapper und support it, but is there a way of adding extra styles on these modules? Adding an extra |
that seems reasonable to me that we allow a className attribute like other navbar items Do you want to send a PR ? |
Sure I can add a PR there. |
Relevant issue in case there's too much spacing after upgrading: #7536 @JPeer264 didn't you encounter this problem with docusaurus-search-local ? |
Motivation
Adjustment styles must be applied equally to all search blocks, not just from the Algolia one. Otherwise, the lack of proper styling in other custom search bars will lead to the following result:
https://nomicon.io/ as example
Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
Preview (no visual changes, it just adds search wrapper to all search bars)
Related PRs