2022-05-10 03:54:00 +00:00
|
|
|
@width-search-bar: 480px;
|
|
|
|
|
|
|
|
.citizen-search {
|
|
|
|
--width-search-bar: @width-search-bar;
|
2022-09-29 23:12:56 +00:00
|
|
|
--height-search-bar: var( --header-button-size );
|
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
|
|
|
display: flex;
|
|
|
|
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
|
|
|
gap: 0.25rem;
|
|
|
|
.citizen-card();
|
2022-12-03 03:18:29 +00:00
|
|
|
.citizen-card-hide( top center, '', false );
|
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 );
|
|
|
|
|
|
|
|
&:before {
|
|
|
|
background-size: 1rem;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-05-10 03:54:00 +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
|
|
|
&__icon,
|
2022-05-10 03:54:00 +00:00
|
|
|
&__random {
|
2022-12-02 22:35:15 +00:00
|
|
|
// So that searchInput has the full width,
|
|
|
|
// and search suggestions will match that width
|
|
|
|
position: absolute;
|
|
|
|
}
|
|
|
|
|
|
|
|
&__icon {
|
|
|
|
left: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
&__random {
|
|
|
|
right: 0;
|
2022-05-10 03:54:00 +00:00
|
|
|
border-radius: var( --border-radius--small );
|
|
|
|
|
2022-11-03 01:47:33 +00:00
|
|
|
.citizen-ui-icon:before {
|
|
|
|
transition: @transition-transform;
|
2022-05-10 03:54:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
background-color: var( --background-color-quiet--hover );
|
|
|
|
|
2022-11-03 01:47:33 +00:00
|
|
|
.citizen-ui-icon:before {
|
2022-05-10 03:54:00 +00:00
|
|
|
opacity: var( --opacity-icon-base--hover );
|
|
|
|
transform: rotate( 30deg );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&:active {
|
|
|
|
background-color: var( --background-color-quiet--active );
|
|
|
|
|
2022-11-03 01:47:33 +00:00
|
|
|
.citizen-ui-icon:before {
|
2022-05-10 03:54:00 +00:00
|
|
|
opacity: var( --opacity-icon-base--active );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-12-02 22:35:15 +00:00
|
|
|
#searchform {
|
2022-05-10 03:54:00 +00:00
|
|
|
flex-grow: 1;
|
2022-12-02 22:35:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#searchInput {
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
padding: 0 var( --height-search-bar );
|
2022-05-10 03:54:00 +00:00
|
|
|
border: 0; // Cancel default border
|
|
|
|
appearance: none;
|
|
|
|
background: transparent; // Cancel default background
|
|
|
|
font-size: 0.8125rem;
|
|
|
|
|
|
|
|
&: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 );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// 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 );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.citizen-animations-ready {
|
|
|
|
.citizen-search__card {
|
|
|
|
.citizen-card-transition();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-09-29 23:12:56 +00:00
|
|
|
@media ( max-width: @width-breakpoint-desktop ) {
|
2022-05-10 03:54:00 +00:00
|
|
|
.citizen-search__card {
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
2022-09-29 23:12:56 +00:00
|
|
|
|
|
|
|
#citizen-search__checkbox:checked {
|
|
|
|
+ .citizen-search__card {
|
|
|
|
z-index: 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
// HACK: Click overlay to dismiss search bar
|
|
|
|
~ .citizen-search__button {
|
|
|
|
.citizen-search__buttonIcon {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
#citizen-search__buttonCheckbox {
|
|
|
|
position: fixed;
|
|
|
|
z-index: 1;
|
|
|
|
top: 0;
|
|
|
|
right: 0;
|
|
|
|
bottom: 0;
|
|
|
|
left: 0;
|
|
|
|
width: auto;
|
|
|
|
height: auto;
|
|
|
|
background-color: var( --background-color-overlay );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-05-10 03:54:00 +00:00
|
|
|
}
|