2023-08-29 19:32:28 +00:00
|
|
|
@width-search-bar: 640px;
|
2022-05-10 03:54:00 +00:00
|
|
|
|
|
|
|
.citizen-search {
|
|
|
|
--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-05-30 06:19:53 +00:00
|
|
|
.citizen-menu__card {
|
|
|
|
--size-icon: var( --height-search-bar );
|
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 ) )';
|
|
|
|
height: var( --height-search-bar );
|
2024-05-30 06:19:53 +00:00
|
|
|
margin-right: auto;
|
|
|
|
margin-left: auto;
|
|
|
|
overflow: initial;
|
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
|
|
|
|
2022-11-03 01:47:33 +00:00
|
|
|
.citizen-ui-icon {
|
2023-02-28 21:59:36 +00:00
|
|
|
&::before {
|
2022-11-03 01:47:33 +00:00
|
|
|
background-size: 1rem;
|
|
|
|
}
|
|
|
|
}
|
2022-05-10 03:54:00 +00:00
|
|
|
}
|
|
|
|
|
2023-07-10 20:23:48 +00:00
|
|
|
&__formButton {
|
2023-07-16 20:48:14 +00:00
|
|
|
cursor: pointer;
|
2023-07-28 01:19:27 +00:00
|
|
|
border-radius: var( --border-radius--small );
|
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 {
|
|
|
|
background-color: var( --background-color-quiet--hover );
|
|
|
|
|
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 {
|
|
|
|
background-color: var( --background-color-quiet--active );
|
|
|
|
|
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--active );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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 );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-03-01 20:27:29 +00:00
|
|
|
&__form {
|
2023-07-10 19:13:21 +00:00
|
|
|
display: flex;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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-02-26 22:16:07 +00:00
|
|
|
font-size: var( --font-size-small );
|
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
|
|
|
|
2023-08-27 09:00:37 +00:00
|
|
|
// HACK: Target mobile Safari only to prevent auto zooming the input field
|
|
|
|
@supports (-webkit-touch-callout: none) {
|
2023-08-15 03:48:09 +00:00
|
|
|
font-size: 1rem;
|
|
|
|
}
|
|
|
|
|
2022-05-10 03:54:00 +00:00
|
|
|
&:focus {
|
|
|
|
outline: 0;
|
|
|
|
// The search suggestion pop-up indicates for focus state
|
|
|
|
// border-color: var( --color-primary );
|
|
|
|
// box-shadow: inset 0 0 0 1px var( --color-primary );
|
|
|
|
}
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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 {
|
|
|
|
z-index: 1; // So that overlay does not cover 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-05-30 06:19:53 +00:00
|
|
|
.citizen-animations-ready & .citizen-menu__dropdown[ open ] > .citizen-menu__card {
|
2022-05-10 03:54:00 +00:00
|
|
|
transition: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|