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

fix(theme): avoid rendering empty search container if site has no search plugin #9385

Merged
merged 2 commits into from
Oct 8, 2023

Conversation

slorber
Copy link
Collaborator

@slorber slorber commented Oct 8, 2023

Motivation

If a site has no search plugin, we shouldn't display the navbar search container container.

It adds useless paddings and shifts the other navbar items.

image

Not an ideal solution but at least it works. CSS :has is going to be cross-browser supported very soon.

fix #7990
fix #8889

Test Plan

local only

@slorber slorber added the pr: bug fix This PR fixes a bug in a past release. label Oct 8, 2023
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Oct 8, 2023
@netlify
Copy link

netlify bot commented Oct 8, 2023

[V2]

Name Link
🔨 Latest commit ed36538
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/6522eb79a561730007563218
😎 Deploy Preview https://deploy-preview-9385--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@github-actions
Copy link

github-actions bot commented Oct 8, 2023

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO PWA Report
/ 🟠 86 🟢 97 🟢 92 🟢 100 🔴 33 Report
/docs/installation 🟠 80 🟢 98 🟢 92 🟢 100 🟠 89 Report

@netlify
Copy link

netlify bot commented Oct 8, 2023

[V2]

Name Link
🔨 Latest commit 2b9031e
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/6522eb9de4869f0008f65aaa
😎 Deploy Preview https://deploy-preview-9385--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@slorber slorber merged commit 35441b3 into main Oct 8, 2023
29 of 30 checks passed
@slorber slorber deleted the slorber/fix-useless-search-padding branch October 8, 2023 18:04
@github-actions
Copy link

github-actions bot commented Oct 8, 2023

Size Change: +114 B (0%)

Total Size: 1.13 MB

Filename Size Change
website/build/assets/css/styles.********.css 113 kB +66 B (0%)
website/build/assets/js/main.********.js 861 kB +36 B (0%)
ℹ️ View Unchanged
Filename Size Change
website/.docusaurus/globalData.json 117 kB 0 B
website/build/index.html 41.4 kB +12 B (0%)

compressed-size-action

@slorber
Copy link
Collaborator Author

slorber commented Apr 19, 2024

Replaced by simpler CSS solution :empty (#10061)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: bug fix This PR fixes a bug in a past release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Navbar renders a useless SearchBox element when site does not have any search plugin
2 participants