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
|
|
|
|
|
|
|
&__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 ) )';
|
|
|
|
height: var( --height-search-bar );
|
2022-12-03 03:18:29 +00:00
|
|
|
margin: var( --space-md ) auto;
|
2022-05-10 03:54:00 +00:00
|
|
|
.citizen-card();
|
2022-12-03 03:18:29 +00:00
|
|
|
.citizen-card-hide( top center, '', false );
|
2023-07-07 21:02:27 +00:00
|
|
|
.citizen-card-transition();
|
2022-05-10 03:54:00 +00:00
|
|
|
|
2022-11-03 01:47:33 +00:00
|
|
|
.citizen-ui-icon {
|
|
|
|
width: var( --height-search-bar );
|
|
|
|
height: var( --height-search-bar );
|
|
|
|
|
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;
|
2023-08-11 22:45:04 +00:00
|
|
|
font-size: 0.875rem;
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Checkbox hack
|
|
|
|
#citizen-search__checkbox:checked {
|
2022-05-10 15:15:34 +00:00
|
|
|
~ .citizen-search__card {
|
2022-05-10 03:54:00 +00:00
|
|
|
.citizen-card-show( false );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-11-16 22:55:23 +00:00
|
|
|
@media ( max-width: @max-width-breakpoint-tablet ) {
|
2022-05-10 03:54:00 +00:00
|
|
|
.citizen-search__card {
|
2023-01-27 19:19:32 +00:00
|
|
|
z-index: 1; // So that overlay does not cover card
|
2022-05-10 03:54:00 +00:00
|
|
|
width: auto;
|
2022-12-03 03:18:29 +00:00
|
|
|
margin: var( --space-xs );
|
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
|
|
|
|
.citizen-animations-ready & {
|
|
|
|
transition: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|