Skip to content

Instantly share code, notes, and snippets.

@sebkolind
Created April 14, 2019 16:44
Show Gist options
  • Save sebkolind/a7d09e03246aebcf7376b6f1cc0d5c24 to your computer and use it in GitHub Desktop.
Save sebkolind/a7d09e03246aebcf7376b6f1cc0d5c24 to your computer and use it in GitHub Desktop.
Mega dropdown - Vanilla JS - SCSS
.dropdown {
position: absolute;
top: 30px;
z-index: 10;
left: 0;
width: 300px;
height: 300px;
opacity: 0;
transition: transform 0.3s, opacity 0.5s;
will-change: transform, opacity;
background-color: #fff;
border-radius: 4px;
display: flex;
line-height: 1;
box-shadow: 0 2px 15px 0 rgba(0, 0, 0, 0.15);
&::before {
content: '';
position: absolute;
left: 50%;
bottom: 100%;
border: solid transparent;
border-color: rgba(245, 245, 240, 0);
border-bottom-color: #fff;
border-width: 8px;
margin-left: -8px;
}
}
nav {
position: absolute;
left: 50%;
top: 0;
transform: translateX(-50%);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment