2024-09-26 19:51:36 +00:00
|
|
|
@width-search-bar: 800px;
|
|
|
|
@position-offset-y-desktop: 3.5rem; /* Sync with search button position */
|
2022-05-10 03:54:00 +00:00
|
|
|
|
|
|
|
.citizen-search {
|
2024-09-27 02:18:29 +00:00
|
|
|
--size-icon: 1rem;
|
2022-05-10 03:54:00 +00:00
|
|
|
--width-search-bar: @width-search-bar;
|
2023-08-29 08:50:55 +00:00
|
|
|
--height-search-bar: 2.75rem;
|
2022-05-10 03:54:00 +00:00
|
|
|
|
2024-09-26 18:55:49 +00:00
|
|
|
@media ( min-width: @min-width-breakpoint-desktop ) {
|
|
|
|
--height-search-bar: 3rem;
|
|
|
|
}
|
|
|
|
|
2024-05-30 06:19:53 +00:00
|
|
|
.citizen-menu__card {
|
2022-12-03 03:18:29 +00:00
|
|
|
position: fixed;
|
|
|
|
top: 0;
|
|
|
|
right: 0;
|
|
|
|
left: 0;
|
2022-05-10 03:54:00 +00:00
|
|
|
width: var( --width-search-bar );
|
|
|
|
max-width: ~'calc(100vw - var( --padding-page ) )';
|
2024-09-26 19:51:36 +00:00
|
|
|
max-height: var( --header-card-maxheight );
|
2024-05-30 06:19:53 +00:00
|
|
|
margin-right: auto;
|
|
|
|
margin-left: auto;
|
2024-09-26 19:51:36 +00:00
|
|
|
overflow-y: auto;
|
|
|
|
overscroll-behavior: contain;
|
2024-05-28 02:47:46 +00:00
|
|
|
transform-origin: center var( --transform-origin-offset-start );
|
2024-05-30 06:19:53 +00:00
|
|
|
contain: none;
|
2022-05-10 03:54:00 +00:00
|
|
|
|
2024-09-26 18:55:49 +00:00
|
|
|
@media ( min-width: @min-width-breakpoint-desktop ) {
|
2024-09-26 19:51:36 +00:00
|
|
|
top: @position-offset-y-desktop;
|
2024-09-27 02:40:20 +00:00
|
|
|
max-height: ~'calc( 100vh - ( var( --space-xs ) + @{position-offset-y-desktop} ) * 2 )';
|
2024-09-26 19:51:36 +00:00
|
|
|
overflow-y: auto;
|
2022-11-03 01:47:33 +00:00
|
|
|
}
|
2022-05-10 03:54:00 +00:00
|
|
|
}
|
|
|
|
|
2024-07-08 19:33:02 +00:00
|
|
|
.citizen-dropdown-details[ open ] + .citizen-menu__card > .citizen-search__form {
|
|
|
|
transition: none; /* Do not animate typeahead since it looks weird */
|
|
|
|
}
|
|
|
|
|
2024-09-26 18:55:49 +00:00
|
|
|
&__formButton,
|
|
|
|
&__formIcon {
|
|
|
|
display: grid;
|
|
|
|
place-content: center;
|
2024-09-26 19:51:36 +00:00
|
|
|
/* Sync with left icons (--size-icon + --space-sm * 2) and typeahead */
|
|
|
|
width: ~'calc( 1.25rem + var( --space-sm ) * 2 )';
|
2024-09-27 02:00:13 +00:00
|
|
|
height: var( --height-search-bar );
|
2024-09-26 18:55:49 +00:00
|
|
|
}
|
|
|
|
|
2023-07-10 20:23:48 +00:00
|
|
|
&__formButton {
|
2023-07-16 20:48:14 +00:00
|
|
|
cursor: pointer;
|
2024-07-05 17:24:31 +00:00
|
|
|
border-radius: var( --border-radius-base );
|
2022-05-10 03:54:00 +00:00
|
|
|
|
2023-02-28 21:59:36 +00:00
|
|
|
.citizen-ui-icon::before {
|
2023-07-07 20:36:27 +00:00
|
|
|
transition: var( --transition-hover );
|
2023-07-10 20:23:48 +00:00
|
|
|
transition-property: opacity;
|
2022-05-10 03:54:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
&:hover {
|
2024-07-01 00:41:31 +00:00
|
|
|
background-color: var( --background-color-button-quiet--hover );
|
2022-05-10 03:54:00 +00:00
|
|
|
|
2023-02-28 21:59:36 +00:00
|
|
|
.citizen-ui-icon::before {
|
2022-05-10 03:54:00 +00:00
|
|
|
opacity: var( --opacity-icon-base--hover );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&:active {
|
2024-07-01 00:41:31 +00:00
|
|
|
background-color: var( --background-color-button-quiet--active );
|
2022-05-10 03:54:00 +00:00
|
|
|
|
2023-02-28 21:59:36 +00:00
|
|
|
.citizen-ui-icon::before {
|
2024-06-30 05:04:30 +00:00
|
|
|
opacity: var( --opacity-icon-base--selected );
|
2022-05-10 03:54:00 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-10 20:23:48 +00:00
|
|
|
&__clear {
|
|
|
|
.citizen-ui-icon::before {
|
|
|
|
background-size: 0.875rem; // Align with text size
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&__random {
|
|
|
|
.citizen-ui-icon::before {
|
|
|
|
transition-property: opacity, transform;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
.citizen-ui-icon::before {
|
|
|
|
transform: rotate( 30deg );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-09-27 02:28:06 +00:00
|
|
|
&__form,
|
|
|
|
&__footer {
|
2024-09-26 19:51:36 +00:00
|
|
|
position: sticky;
|
|
|
|
z-index: @z-index-stacking-1;
|
2024-09-27 02:28:06 +00:00
|
|
|
background-color: inherit;
|
|
|
|
filter: opacity( 0.9 );
|
|
|
|
-webkit-backdrop-filter: saturate( 50% ) blur( 16px );
|
|
|
|
backdrop-filter: saturate( 50% ) blur( 16px );
|
|
|
|
}
|
|
|
|
|
|
|
|
&__form {
|
|
|
|
top: 0;
|
2023-07-10 19:13:21 +00:00
|
|
|
display: flex;
|
2024-09-26 18:55:49 +00:00
|
|
|
height: 100%;
|
2024-09-26 21:47:19 +00:00
|
|
|
overflow: hidden;
|
2024-09-26 18:55:49 +00:00
|
|
|
font-size: var( --font-size-small );
|
|
|
|
|
|
|
|
// HACK: Target mobile Safari only to prevent auto zooming the input field
|
|
|
|
@supports (-webkit-touch-callout: none) {
|
|
|
|
font-size: 1rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
@media ( min-width: @min-width-breakpoint-desktop ) {
|
|
|
|
font-size: var( --font-size-medium );
|
|
|
|
}
|
2023-07-10 19:13:21 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Loading indicator for searchbox
|
|
|
|
* See common/progressbar.less
|
|
|
|
**/
|
|
|
|
&.citizen-loading::after {
|
|
|
|
position: absolute;
|
|
|
|
top: 100%;
|
|
|
|
}
|
2022-12-02 22:35:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#searchInput {
|
2023-07-10 19:13:21 +00:00
|
|
|
flex-grow: 1;
|
|
|
|
padding: 0;
|
2024-09-26 18:55:49 +00:00
|
|
|
font-size: inherit;
|
2022-05-10 03:54:00 +00:00
|
|
|
appearance: none;
|
|
|
|
background: transparent; // Cancel default background
|
2023-07-28 01:19:27 +00:00
|
|
|
border: 0; // Cancel default border
|
2022-05-10 03:54:00 +00:00
|
|
|
|
|
|
|
&:focus {
|
|
|
|
outline: 0;
|
|
|
|
// The search suggestion pop-up indicates for focus state
|
2024-06-30 05:04:30 +00:00
|
|
|
// border-color: var( --color-progressive );
|
|
|
|
// box-shadow: inset 0 0 0 1px var( --color-progressive );
|
2022-05-10 03:54:00 +00:00
|
|
|
}
|
2023-07-10 20:23:48 +00:00
|
|
|
|
|
|
|
// Remove browser native clear all button in search field
|
|
|
|
&::-webkit-search-cancel-button {
|
|
|
|
-webkit-appearance: none;
|
|
|
|
}
|
2022-05-10 03:54:00 +00:00
|
|
|
}
|
2024-09-26 21:47:19 +00:00
|
|
|
|
|
|
|
&__footer {
|
2024-09-26 23:29:56 +00:00
|
|
|
bottom: 0;
|
2024-09-26 21:47:19 +00:00
|
|
|
display: flex;
|
|
|
|
gap: var( --space-lg );
|
|
|
|
align-items: center;
|
|
|
|
justify-content: space-between;
|
|
|
|
min-height: 2.5rem;
|
|
|
|
padding: 0 var( --space-md );
|
|
|
|
overflow: hidden;
|
|
|
|
font-size: var( --font-size-x-small );
|
2024-09-26 21:58:53 +00:00
|
|
|
color: var( --color-subtle );
|
2024-09-26 21:47:19 +00:00
|
|
|
white-space: nowrap;
|
|
|
|
border-top: 1px solid var( --border-color-base );
|
|
|
|
|
|
|
|
&-start,
|
|
|
|
&-end {
|
|
|
|
display: flex;
|
|
|
|
gap: var( --space-md );
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
}
|
2022-05-10 03:54:00 +00:00
|
|
|
}
|
|
|
|
|
2023-11-16 22:55:23 +00:00
|
|
|
@media ( max-width: @max-width-breakpoint-tablet ) {
|
2024-05-30 06:19:53 +00:00
|
|
|
.citizen-search {
|
|
|
|
.citizen-menu__card {
|
|
|
|
width: auto;
|
|
|
|
}
|
2022-05-10 03:54:00 +00:00
|
|
|
|
|
|
|
// Remove searchbox open animation on mobile
|
|
|
|
// But keep suggestion animation
|
|
|
|
// So user can get to search instantly
|
2024-07-03 20:07:08 +00:00
|
|
|
> .citizen-dropdown[ open ] > .citizen-menu__card {
|
2022-05-10 03:54:00 +00:00
|
|
|
transition: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|