Replies: 1 comment
-
|
Based on the screenshot provided, the issue you are experiencing on mobile is a common side effect of how Docusaurus structures its navigation. The mobile sidebar ( The SolutionTo fix this, you need to explicitly re-apply a solid background color to the mobile sidebar so the frosted glass effect only applies to the top navigation bar. Add the following to your /* Your frosted glass navbar */
.navbar {
box-shadow: none;
/* Using a slight opacity like 0.6 or 0.8 usually looks better for frosted glass than 0 */
background-color: rgba(255, 255, 255, 0.7);
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px); /* Added for Safari compatibility */
}
/* Reset the mobile sidebar to be solid */
.navbar-sidebar {
background-color: var(--ifm-navbar-background-color);
backdrop-filter: none;
-webkit-backdrop-filter: none;
}Note for Dark Mode: If you support dark mode, hardcoding html[data-theme='dark'] .navbar {
background-color: rgba(0, 0, 0, 0.7);
}If this answer helped or pointed you in the right direction, I'd appreciate it if you could mark it as the accepted answer so it's easier for others with the same issue to find. Also, if you found my contribution useful, I'd appreciate it if you could check out my GitHub profile, follow me, and star any repositories you find interesting. GitHub: https://github.com/Advait251206 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
When I add frosted glass effect to the navigation bar, the sidebar on the mobile phone cannot be displayed correctly.

It turns into what it looks like in the picture, did I make a mistake somewhere in the css style below?
But it displays as expected on the desktop.
Beta Was this translation helpful? Give feedback.
All reactions