I can't get CSS to work in one particular part of my project. Works fine with other components.
index.tsx
const toggleMenu = () => {
setMenuOpen(!menuOpen);
}
return (
....
<div className={`${styles.menu} ${menuOpen ? styles.active : ''}`}>
<button className={styles.navTgl} onClick={toggleMenu} aria-label="toggle menu">
<span aria-hidden="true"></span>
</button>
<nav className={styles.nav}>
<ul>
<li>Home</li>
<li>Docs</li>
<li>About Us</li>
</ul>
</nav>
</div>
....
Home.module.css
.nav:before {
display: block;
position: fixed;
top: 0;
left: 0;
content: '';
width: 100vw;
height: 100vh;
background: rgba(0, 0, 0, 0.8);
transition: all 500ms ease-in-out;
clip-path: circle(30px at calc(0% + 55px) 55px);
visibility: hidden;
backdrop-filter: blur(10px);
}
.menu.active .nav:before {
visibility: visible;
clip-path: circle(100%);
}
This is the logic of the code to open the menu box. I'm getting to open it, but the line
transition: all 500ms ease-in-out; doesn't seem to work
I've tried using opacity and transform but doesn't change anything. Tried increasing trasition time and -webkit-transition as well