Make the topbar backdrop blur

Good day guys. How can i make the fi-topbar blur? .fi .fi-topbar { @apply backdrop-blur-sm; } that code is not working, via custom theme.css
21 Replies
fenerli
fenerli7d ago
hello. HTML Structure: html Copy code <div class="fi-topbar"> <h1>My Website</h1> <nav> <ul> <li><a href="#">Home</a></li> <li><a href="#">About</a></li> <li><a href="#">Contact</a></li> </ul> </nav> </div> CSS Styles: css Copy code body { background: url('your-background-image.jpg') no-repeat center center fixed; background-size: cover; height: 100vh; margin: 0; } .fi-topbar { position: fixed; top: 0; left: 0; right: 0; background: rgba(255, 255, 255, 0.5); /* Semi-transparent background / backdrop-filter: blur(10px); / Adjust the blur amount / padding: 10px; z-index: 1000; } .fi-topbar nav ul { list-style: none; display: flex; gap: 20px; } .fi-topbar nav a { text-decoration: none; color: #000; / Text color */ } if you do it. you get you want i am a senior web developer. My skills : 1) confident in HTML5 / CSS / LESS / SASS Bootstrap etc 2) ReactJS 3) NodeJS / ExpressJS 4) Database - MySQL, Mongo DB, MSSQL 5) PHP 6) Zend Codeignitor Laravel don't you need to senior web developer if you are insterested, please contact me 💯
Diogo Pinto
Diogo Pinto7d ago
@EMMAN what do you exactly mean by blur? You want a shadow or you want it to be transparent and blur the background? If you can post a screenshot of your topbar that would maybe help. Let me know!
EMMAN
EMMAN7d ago
like that, sir @Diogo Pinto
No description
EMMAN
EMMAN7d ago
Backdrop Blur - Tailwind CSS
Utilities for applying backdrop blur filters to an element.
fenerli
fenerli7d ago
oh, sorry. If you're using Tailwind CSS with the @apply directive to add a blur effect, make sure you've set up your Tailwind CSS configuration correctly. Here’s how you can achieve the blur effect on your .fi-topbar: 1.Ensure Tailwind CSS is configured: Make sure that your tailwind.config.js includes the necessary plugins and settings for backdrop-filter. 2.Use the Correct Utility: The class backdrop-blur-sm should work if Tailwind is configured correctly. If it's not applying, you might want to check your setup. 3.Example CSS: Here's how you might set it up in your theme.css: css Copy code @tailwind base; @tailwind components; @tailwind utilities; .fi .fi-topbar { @apply backdrop-blur-sm bg-white bg-opacity-50; /* Adjust background as needed / } 4.Check Your Build Process: Make sure your CSS is being compiled correctly. Sometimes, changes won't reflect if the build process is not running or if there's an error in your setup. 5.Add Vendor Prefixes: If you're still having issues, you might need to add vendor prefixes for compatibility. You can do this by adding: css Copy code .fi .fi-topbar { backdrop-filter: blur(4px); / Fallback */ @apply backdrop-blur-sm bg-white bg-opacity-50; } Debugging Steps: 6.Inspect Element: Use the browser's developer tools to inspect the .fi-topbar element and check if the styles are being applied correctly. 7.Check Tailwind CSS Version: Ensure you're using a version of Tailwind that supports backdrop-filter. 8.Build Configuration: Make sure your build tools (like PostCSS) are set up to handle @apply correctly. Let me know if you need further assistance!
EMMAN
EMMAN7d ago
result:
EMMAN
EMMAN7d ago
No description
EMMAN
EMMAN7d ago
No description
EMMAN
EMMAN7d ago
not working @fenerli
Diogo Pinto
Diogo Pinto7d ago
I think the previous answer is from an AI bot. Let me get to my laptop and I’ll try to reproduce something that works for you
EMMAN
EMMAN7d ago
oright, thanks sir @Diogo Pinto
fenerli
fenerli7d ago
.fi .fi-topbar{ --tw-blur: blur(16px) }
EMMAN
EMMAN7d ago
i tried, but nothing happens, sir @fenerli
No description
No description
Diogo Pinto
Diogo Pinto7d ago
@EMMAN here's a quick example, below I'll share my code
No description
Diogo Pinto
Diogo Pinto7d ago
I put the yellow background just for demonstration purposes
.fi-topbar nav, .fi-sidebar-header {
@apply backdrop-blur-sm bg-white bg-opacity-50;
}
.fi-topbar nav, .fi-sidebar-header {
@apply backdrop-blur-sm bg-white bg-opacity-50;
}
You should also add the dark: variables to enable this in dark mode
fenerli
fenerli7d ago
.fi-topbar nav, .fi-sidebar-header { @apply backdrop-blur-sm bg-white bg-opacity-50; } @media (prefers-color-scheme: dark) { .fi-topbar nav, .fi-sidebar-header { @apply bg-gray-800 bg-opacity-70; /* Dark background */ } }
fenerli
fenerli7d ago
No description
fenerli
fenerli7d ago
No description
EMMAN
EMMAN7d ago
this is working. thanks to @Diogo Pinto
No description
EMMAN
EMMAN7d ago
but, problem is this, with Notification:
No description
EMMAN
EMMAN7d ago
current code: .fi-topbar nav, .fi-sidebar-header { @apply backdrop-blur-sm bg-white bg-opacity-80 dark:bg-[#1A1D21] dark:bg-opacity-80; }
Want results from more Discord servers?
Add your server