mediawiki-skins-Citizen/resources/skins.citizen.search/skins.citizen.search.less

275 lines
4.8 KiB
Plaintext
Raw Normal View History

@import '../variables.less';
@import '../mixins.less';
.citizen-typeahead {
display: flex;
flex-direction: column;
gap: var( --space-xs );
margin: var( --space-xs ) 0;
list-style: none;
border-bottom-right-radius: var( --border-radius-medium );
border-bottom-left-radius: var( --border-radius-medium );
a {
&:hover,
&:focus {
text-decoration: none;
}
}
&-input {
// Display overlay instead of the input, but keep the caret
color: transparent;
caret-color: var( --color-emphasized );
&-group {
position: relative;
display: flex;
flex-grow: 1;
}
&-overlay {
position: absolute;
inset: 0 var( --height-search-bar ) 0 0; // clear button
display: flex;
align-items: center;
overflow: hidden;
white-space: nowrap;
pointer-events: none;
&-query {
color: var( --color-emphasized );
}
}
}
&-item {
&-group {
&-list {
margin: 0;
list-style: none;
}
// FIXME: Use a generic attribute
&[ data-mw-citizen-typeahead-group='action' ] .citizen-typeahead-item-group-list {
display: flex;
gap: var( --space-xxs );
padding-right: var( --space-sm );
padding-left: var( --space-sm );
overflow-x: auto;
}
}
}
&__item {
&--active {
background-color: var( --background-color-button-quiet--hover );
}
&--hidden {
display: none;
}
&-chip {
white-space: nowrap;
border-radius: var( --border-radius-medium );
.citizen-typeahead {
&__content {
margin: 0;
border: var( --border-width-base ) solid var( --border-color-base );
border-radius: var( --border-radius-medium );
}
&__thumbnail {
width: 1rem;
height: 1rem;
}
}
}
&-sm {
font-size: var( --font-size-small );
.citizen-typeahead {
&__content {
padding-top: var( --space-sm );
padding-bottom: var( --space-sm );
}
&__thumbnail {
height: var( --size-icon );
background-color: transparent;
&.citizen-ui-icon {
width: var( --size-icon );
}
}
}
}
&-md {
.citizen-typeahead {
&__thumbnail {
background-color: #eaecf0;
background-position: center;
background-size: cover;
border-radius: var( --border-radius-medium );
&.citizen-ui-icon {
width: 100%;
height: 60px;
background-color: var( --color-surface-3 );
.citizen-typeahead &::before {
background-size: 20px;
}
}
}
}
}
&-lg {
.citizen-typeahead {
&__content {
flex-direction: column;
padding-top: var( --space-xl );
padding-bottom: var( --space-xl );
text-align: center;
}
&__thumbnail {
margin-bottom: var( --space-sm );
}
}
}
&-sm,
&-md {
.citizen-typeahead {
&__thumbnail {
margin-right: var( --space-sm );
}
&__text {
white-space: nowrap;
}
}
}
&-md,
&-lg {
.citizen-typeahead {
&__title {
font-size: var( --font-size-medium );
font-weight: var( --font-weight-semibold );
}
&__description {
margin-top: 0.1rem;
}
}
}
}
&__content {
display: flex;
align-items: center;
padding: var( --space-xs ) var( --space-sm );
color: var( --color-base );
}
&__thumbnail {
flex-shrink: 0;
width: 100%;
max-width: 60px;
height: 60px;
overflow: hidden;
// Needed the specificity, we should refactor this
.citizen-typeahead &.citizen-ui-icon::before {
background-size: contain;
}
}
&__text {
flex-grow: 1;
overflow: hidden;
}
&__header {
display: flex;
justify-content: space-between;
}
&__title {
flex-shrink: 0;
color: var( --color-emphasized );
}
&__highlight {
font-weight: var( --font-weight-medium );
color: var( --color-subtle );
}
&__query {
font-weight: var( --font-weight-semibold );
color: var( --color-emphasized );
}
&__label {
display: flex;
gap: var( --space-xxs );
margin-left: var( --space-xs );
font-size: var( --font-size-small );
color: var( --color-base );
}
&__labelItem {
display: flex;
gap: var( --space-xxs );
align-items: center;
}
&__description,
&__labelItem {
font-size: var( --font-size-x-small );
color: var( --color-subtle );
}
&__title,
&__description {
overflow: hidden;
text-overflow: ellipsis;
}
&__actions {
position: absolute;
right: var( --space-sm );
}
&__keyboard {
display: none;
padding: 0 8px;
background-color: var( --color-surface-1 );
border-radius: var( --border-radius-base );
}
}
// HACK: This is as close as we can to detect whether there is a keyboard in CSS
@media ( hover: hover ) and ( pointer: fine ) {
.citizen-typeahead {
&__item--active {
.citizen-typeahead__keyboard {
display: block;
}
}
}
}
// HACK: Hide default MW search suggestion if it somehow loaded
// This should be removed when we switch to vue search
.suggestions {
display: none !important;
}