1
0
mirror of https://github.com/phuoc-ng/csslayout.git synced 2025-10-23 18:56:29 +02:00
Files
csslayout/styles/patterns/_dropdown.scss
Phuoc Nguyen fe219f7c79 feat: Dropdown
2022-09-22 09:11:43 +07:00

53 lines
968 B
SCSS

.dropdown {
position: relative;
/* Demo */
width: 6rem;
align-items: flex-start;
display: flex;
justify-content: center;
}
.dropdown__trigger {
cursor: pointer;
/* Demo */
border: 1px solid #d1d5db;
border-radius: 0.25rem;
height: 2rem;
width: 6rem;
padding: 0.25rem 0.5rem;
align-items: center;
display: flex;
justify-content: center;
}
/* Hide the dropdown's content by default */
.dropdown__content {
display: none;
/* Position it right below the trigger element */
left: 0;
padding-top: 0.25rem;
position: absolute;
top: 100%;
/* It should be on the top of other elements */
background-color: #fff;
z-index: 9999;
}
.dropdown__body {
/* Demo */
border: 1px solid #d1d5db;
border-radius: 0.25rem;
height: 6rem;
width: 8rem;
}
/* Show the content when hover on the container */
.dropdown:hover .dropdown__content {
display: block;
}