Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Adding backdrop-filter blur on navbar breaks offcanvas element #40575

Closed
3 tasks done
firesightstudios opened this issue Jun 21, 2024 · 4 comments
Closed
3 tasks done

Comments

@firesightstudios
Copy link

firesightstudios commented Jun 21, 2024

Prerequisites

Describe the issue

Create a Navbar With offCanvas element & add custom class

<nav class="navbar fixed-top customNavbar-mobile">

Add css to custom class

.customNavbar-mobile { background-color: #282d43cc !important; backdrop-filter: blur(5px); }

Offcanvas breaks.

Reduced test cases

https://codepen.io/Justin-Zimmerman/pen/WNBzLBB

What operating system(s) are you seeing the problem on?

Windows

What browser(s) are you seeing the problem on?

Firefox

What version of Bootstrap are you using?

5.3.3

@LadonAl
Copy link

LadonAl commented Jun 22, 2024

This does not seem to be a bug actually. Refer to this

I believe that something like this should solve your problem:

.customNavbar-mobile {
  background-color: #282d43cc !important;
}

.customNavbar-mobile .offcanvas-backdrop {
  backdrop-filter: blur(5px);
}

@firesightstudios
Copy link
Author

firesightstudios commented Jun 22, 2024

This does not seem to be a bug actually. Refer to this

I believe that something like this should solve your problem:

.customNavbar-mobile {
  background-color: #282d43cc !important;
}

.customNavbar-mobile .offcanvas-backdrop {
  backdrop-filter: blur(5px);
}

Thanks for the reply, but for some reason when you do that the transparency with the blur changes

.customNavbar-mobile {
        background-color: #282d43cc !important;
        backdrop-filter: blur(20px);
}

Produces:

normalblur

.customNavbar-mobile {
        background-color: #282d43cc !important;
}

.customNavbar-mobile .offcanvas-backdrop {
        backdrop-filter: blur(20px);
}

Produces:

changedblur

^^ Your method partially works but the blur is ignored no matter the amount you apply to it.

@firesightstudios
Copy link
Author

So it looks like adding height: 100vh; to the .offcanvas fixes the issue. height: 100%; does not work.

My final code that works:

.offcanvas {
        height: 100vh;
}

.customNavbar-mobile {
        backdrop-filter: blur(20px);
}

@firesightstudios
Copy link
Author

Working Codepen with changes

https://codepen.io/Justin-Zimmerman/pen/jOoxOVw

not sure if this is a bug ill let someone else decide if this should be closed.

@twbs twbs locked and limited conversation to collaborators Jun 24, 2024
@julien-deramond julien-deramond converted this issue into discussion #40576 Jun 24, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants