2024-07-03 20:07:08 +00:00
|
|
|
.citizen-dropdown {
|
2024-07-09 20:44:15 +00:00
|
|
|
.citizen-menu__card {
|
|
|
|
z-index: @z-index-dropdown;
|
2024-11-06 02:50:54 +00:00
|
|
|
content-visibility: hidden;
|
2024-10-22 18:54:02 +00:00
|
|
|
max-width: 80vw;
|
2024-10-19 04:48:20 +00:00
|
|
|
transition-timing-function: var( --transition-timing-function-ease-in );
|
|
|
|
transition-duration: var( --transition-duration-base );
|
2024-11-06 02:50:54 +00:00
|
|
|
transition-property: transform, content-visibility;
|
|
|
|
transition-behavior: allow-discrete;
|
2024-10-19 04:48:20 +00:00
|
|
|
|
|
|
|
> * {
|
2024-11-06 02:50:54 +00:00
|
|
|
opacity: 0;
|
2024-10-19 04:48:20 +00:00
|
|
|
transition-timing-function: var( --transition-timing-function-ease-in );
|
|
|
|
transition-duration: var( --transition-duration-base );
|
|
|
|
transition-property: opacity;
|
|
|
|
}
|
2024-07-09 20:44:15 +00:00
|
|
|
}
|
|
|
|
|
2024-07-03 20:07:08 +00:00
|
|
|
&-summary {
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
|
|
// Icons have to use span inside label elements
|
|
|
|
> span:not( .citizen-ui-icon ) {
|
|
|
|
.sr-only;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
background-color: var( --background-color-button-quiet--hover );
|
|
|
|
|
|
|
|
> .citizen-ui-icon::before {
|
|
|
|
opacity: var( --opacity-icon-base--hover );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&:active {
|
|
|
|
background-color: var( --background-color-button-quiet--active );
|
|
|
|
|
|
|
|
> .citizen-ui-icon::before {
|
|
|
|
opacity: var( --opacity-icon-base--selected );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Remove Safari summary marker
|
|
|
|
&::-webkit-details-marker {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Reset hover styles if it is a touch device
|
|
|
|
// This is dumb but hover:hover overrides active states
|
|
|
|
@media ( hover: none ) {
|
|
|
|
&:hover {
|
|
|
|
background-color: transparent;
|
|
|
|
|
|
|
|
.citizen-ui-icon::before {
|
|
|
|
opacity: var( --opacity-icon-base );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&-details {
|
|
|
|
&[ open ] {
|
|
|
|
+ .citizen-menu__card {
|
2024-11-06 02:50:54 +00:00
|
|
|
content-visibility: visible;
|
2024-10-19 04:48:20 +00:00
|
|
|
transition-timing-function: var( --transition-timing-function-ease-out );
|
|
|
|
transition-duration: var( --transition-duration-medium );
|
2024-07-03 20:07:08 +00:00
|
|
|
transform: none;
|
|
|
|
|
|
|
|
> * {
|
|
|
|
opacity: 1;
|
2024-07-08 19:33:02 +00:00
|
|
|
transition-delay: var( --transition-delay-menu );
|
2024-10-19 04:48:20 +00:00
|
|
|
transition-timing-function: var( --transition-timing-function-ease-out );
|
|
|
|
transition-duration: var( --transition-duration-medium );
|
2024-07-03 20:07:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
> .citizen-dropdown-summary {
|
|
|
|
background-color: var( --background-color-button-quiet--active );
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
background-color: var( --background-color-button-quiet--hover );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@media ( max-width: @max-width-breakpoint-tablet ) {
|
2024-10-22 18:54:02 +00:00
|
|
|
.citizen-menu__card {
|
|
|
|
max-width: ~'calc( 100vw - var( --space-xs ) * 2 )';
|
|
|
|
}
|
|
|
|
|
2024-07-09 20:44:15 +00:00
|
|
|
// Add dismiss affordnance backdrop
|
2024-07-03 20:07:08 +00:00
|
|
|
&-details {
|
|
|
|
&::before {
|
|
|
|
content: '';
|
|
|
|
background: var( --background-color-backdrop-light );
|
2024-07-08 23:07:25 +00:00
|
|
|
-webkit-backdrop-filter: blur( 2px );
|
2024-07-03 20:07:08 +00:00
|
|
|
backdrop-filter: blur( 2px );
|
|
|
|
opacity: 0;
|
2024-10-19 04:48:20 +00:00
|
|
|
transition-timing-function: var( --transition-timing-function-ease );
|
|
|
|
transition-duration: var( --transition-duration-base );
|
|
|
|
transition-property: opacity;
|
2024-07-03 20:07:08 +00:00
|
|
|
}
|
|
|
|
|
2024-07-09 20:44:15 +00:00
|
|
|
&[ open ] {
|
|
|
|
&::before {
|
|
|
|
position: fixed;
|
|
|
|
inset: 0;
|
|
|
|
z-index: @z-index-off-canvas-backdrop;
|
|
|
|
opacity: 1;
|
2024-10-19 04:48:20 +00:00
|
|
|
transition-duration: var( --transition-duration-medium );
|
2024-07-09 20:44:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
> .citizen-dropdown-summary {
|
|
|
|
position: relative;
|
|
|
|
// Slightly higher than the menu so it is not covered by the box shadow
|
|
|
|
z-index: @z-index-off-canvas + @z-index-stacking-1;
|
|
|
|
}
|
|
|
|
|
|
|
|
+ .citizen-menu__card {
|
|
|
|
z-index: @z-index-off-canvas;
|
|
|
|
}
|
2024-07-03 20:07:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@media ( max-width: @max-width-breakpoint-tablet ) {
|
|
|
|
/* HACK: Disable page from scolling when a dropdown menu is opened */
|
|
|
|
body:has( .citizen-dropdown-details[ open ] ) {
|
|
|
|
overflow: hidden;
|
|
|
|
}
|
|
|
|
}
|