@roadtrip/css
Version:
CSS framework for Roadtrip Design System
136 lines (113 loc) • 2.22 kB
CSS
/*
* Profil Dropdown
*
* Index
* - Dropdown
* - Dropdown menu
* - Dropdown item
*/
/* PROFIL DROPDOWN
-------------------- */
.dropdown {
position: relative;
width: max-content;
font-family: var(--road-font);
}
.dropdown summary {
display: block;
outline: none;
}
.dropdown summary::-webkit-details-marker { /* remove native arrow */
display: none;
}
.dropdown-button{
position: relative;
z-index: 1;
height: 3.5rem;
cursor: pointer;
border-radius: 0.25rem;
}
.dropdown-button svg{
width: 2.5rem;
height: 2.5rem;
}
.dropdown-header-top-right{
justify-content: flex-end;
}
/**
* Open state
*/
.dropdown[open] .dropdown-menu {
transform: scaleY(1);
}
.dropdown[open] .dropdown-menu.dropup {
position: absolute;
bottom: 0;
left: 0;
transform: translate3d(0, -56px, 0);
will-change: transform;
}
/* MENU
-------------------- */
.profil-dropdown .dropdown-menu {
position: absolute;
top: 0;
left: 6rem;
z-index: 2;
display: flex;
flex-direction: column;
width: 100%;
min-width: 16.875rem;
padding: 0.5rem 0;
color: var(--road-on-surface);
background: var(--road-surface);
border: 1px solid;
border-color: var(--road-outline-weak);
border-radius: 0.25rem;
box-shadow: var(--road-elevation-low);
transition: transform 0.2s ease-in-out;
transform: scaleY(0);
transform-origin: 0 0;
}
/* ITEM
-------------------- */
.profil-item {
width: 100%;
cursor: auto;
border-bottom: 1px solid var(--road-outline);
}
.profil-item .avatar:hover{
box-shadow: none;
}
.dropdown-item {
display: flex;
align-items: center;
min-height: 40px;
padding: 0 1rem;
font-size: var(--road-button-medium);
line-height: 1.5;
color: var(--road-on-surface);
text-align: left;
text-decoration: none;
cursor: pointer;
background: var(--road-surface);
border: none;
outline: none;
}
.dropdown-item svg{
margin-right: 0.7rem;
}
.dropdown-item-border {
border-bottom: 1px solid var(--road-outline);
}
/**
* Hover state
*/
.dropdown-item:hover:first-child,
.dropdown-item.focus-visible:first-child {
background: none;
}
.dropdown-item:hover,
.dropdown-item.focus-visible {
background: var(--road-surface-inverse);
}