UX: search CSS refactor + fixes (#32401)

* change spacing to use consistent values
* change font weight and colours for search results
* updated copy for mobile to reflect the removal of the search icon
(using native keyboard CTA now)
* results are full-width, in line with other dropdowns; noticable in
hover effects
* trying to make sure all search results items are of equal height, were
possible
* fixing missing `in-this-topic` context button

**Ignore the silly emoji in the screenshots on mobile – different
problem, alrdy fixed on main**

## Desktop
### Search Header
| Before | After |
|--------|--------|
| ![CleanShot 2025-04-23 at 12 11
19@2x](https://github.com/user-attachments/assets/324cf155-9832-4580-8d62-d49436813477)
| ![CleanShot 2025-04-23 at 12 22
23@2x](https://github.com/user-attachments/assets/db9860a4-7e37-418f-85e9-9d68d5a5ab72)
|
| ![CleanShot 2025-04-23 at 12 12
02@2x](https://github.com/user-attachments/assets/0445a36b-1076-4c25-921d-0c2871266b47)|
![CleanShot 2025-04-23 at 11 20
42@2x](https://github.com/user-attachments/assets/93ab484e-2362-4520-9dba-53f2acd7e257)
|
| ![CleanShot 2025-04-23 at 12 12
12@2x](https://github.com/user-attachments/assets/f457b837-0d3c-491f-890d-e9578697dda1)
| ![CleanShot 2025-04-23 at 11 20
52@2x](https://github.com/user-attachments/assets/eec6df3b-0e74-4011-96dd-f531190c28c2)
|
| ![CleanShot 2025-04-23 at 12 14
13@2x](https://github.com/user-attachments/assets/89e3f391-a300-49cb-8f20-0dca10ffc3ad)
| ![CleanShot 2025-04-23 at 11 43
38@2x](https://github.com/user-attachments/assets/9f88c896-868c-4494-924c-bcb5ee26f30a)
|
| ![CleanShot 2025-04-23 at 12 12
34@2x](https://github.com/user-attachments/assets/8dea31e2-b15c-4884-97f3-ff54280d7076)
| ![CleanShot 2025-04-23 at 11 21
17@2x](https://github.com/user-attachments/assets/fe8b2f8a-65d1-43af-9a98-f177b41c3630)
|

### Search Welcome Banner
| Before | After |
|--------|--------|
| ![CleanShot 2025-04-23 at 12 16
17@2x](https://github.com/user-attachments/assets/43a0c727-8a84-4f75-a89c-b2444cbac903)
| ![CleanShot 2025-04-23 at 11 22
29@2x](https://github.com/user-attachments/assets/f3f3e059-deb8-4181-b1ac-a8c4604b50c5)
|
| ![CleanShot 2025-04-23 at 12 16
28@2x](https://github.com/user-attachments/assets/53ef9554-790e-4fbb-9141-4a7b65909cce)
| ![CleanShot 2025-04-23 at 11 22
55@2x](https://github.com/user-attachments/assets/343ed01b-8f4f-41da-af92-93316f2df960)
|
| ![CleanShot 2025-04-23 at 12 16
42@2x](https://github.com/user-attachments/assets/1fdb4fc8-6f04-4161-85b0-dee9e4d444af)
| ![CleanShot 2025-04-23 at 11 23
06@2x](https://github.com/user-attachments/assets/4bc27eb8-29d9-43f6-8ac9-5de66d70cee8)|
| ![CleanShot 2025-04-23 at 12 17
07@2x](https://github.com/user-attachments/assets/85cc8948-3bbf-4aad-abc2-e2ff0966df55)
| ![CleanShot 2025-04-23 at 11 43
02@2x](https://github.com/user-attachments/assets/f566ddf5-25b1-4bcd-91eb-a2ec320e7797)|
| ![CleanShot 2025-04-23 at 12 17
17](https://github.com/user-attachments/assets/43098fed-edef-460b-b7b9-165331ea3c98)
| ![CleanShot 2025-04-23 at 11 43
16@2x](https://github.com/user-attachments/assets/0c6c9f76-0084-4e49-8135-d07b91672182)
|

### Search in Topic
| Before | After |
|--------|--------|
| ![CleanShot 2025-04-23 at 12 19
49@2x](https://github.com/user-attachments/assets/3914cf25-2071-465f-8ed1-bfcb736fc7be)
| ![CleanShot 2025-04-23 at 12 24
32@2x](https://github.com/user-attachments/assets/f0e0a19a-8ca1-4881-8c1c-0c117bd27cc6)
|
| ![CleanShot 2025-04-23 at 12 20
28@2x](https://github.com/user-attachments/assets/c56967f7-624a-4949-a024-b9a45fd31426)
| ![CleanShot 2025-04-23 at 11 53
28@2x](https://github.com/user-attachments/assets/3346972a-4bb8-4362-8480-69fe6f55f49a)
|
| ![CleanShot 2025-04-23 at 12 20
47@2x](https://github.com/user-attachments/assets/b725df3c-4c3d-43d5-b717-0840bc4e07d4)
| ![CleanShot 2025-04-23 at 11 53
45@2x](https://github.com/user-attachments/assets/18c0004b-f09a-4e0a-8e40-e95be6471abc)
|
| ![CleanShot 2025-04-23 at 12 21
42@2x](https://github.com/user-attachments/assets/7ea4e1bd-7325-4440-aac5-ae8d6a572593)
| ![CleanShot 2025-04-23 at 11 44
49@2x](https://github.com/user-attachments/assets/85b6ed6e-8bd4-4a94-8df7-6fe2778f8bc8)
|
| ![CleanShot 2025-04-23 at 12 18
12@2x](https://github.com/user-attachments/assets/2a1c97ef-2062-49b7-9d43-e7b998284939)
| ![CleanShot 2025-04-23 at 11 45
39@2x](https://github.com/user-attachments/assets/3f32555a-1846-4ef7-97e4-9028d547617e)
|
| ![CleanShot 2025-04-23 at 12 20
59@2x](https://github.com/user-attachments/assets/42688cc9-276d-475a-97df-90e76832b3a3)
| ![CleanShot 2025-04-23 at 11 50
35@2x](https://github.com/user-attachments/assets/53d964db-6035-44d5-becf-3a27d2764902)|

## Mobile
| Before | After |
|--------|--------|
| ![CleanShot 2025-04-23 at 12 04
10@2x](https://github.com/user-attachments/assets/3ce86a35-8506-4bea-b9d1-0a28ad18d4b4)
| ![CleanShot 2025-04-23 at 12 01
50@2x](https://github.com/user-attachments/assets/af760c91-9b8c-4445-bcee-e840782dd5ad)
|
| ![CleanShot 2025-04-24 at 18 53
56@2x](https://github.com/user-attachments/assets/9ef215bc-0914-4a54-8e7b-91595fca5aef)
| ![CleanShot 2025-04-24 at 18 50
55@2x](https://github.com/user-attachments/assets/9bcfc456-04df-43e2-b3ac-78f843a42cc3)
|
| ![CleanShot 2025-04-24 at 18 53
46@2x](https://github.com/user-attachments/assets/4f969a98-8990-44bd-8964-809d4e1c1c37)
| ![CleanShot 2025-04-24 at 18 51
55@2x](https://github.com/user-attachments/assets/67dc3b4c-ecc6-468d-874d-0c8face3ca29)
|
| ![CleanShot 2025-04-24 at 18 53
37@2x](https://github.com/user-attachments/assets/0c7eccd4-d4d0-4174-b153-28b87bc48424)
| ![CleanShot 2025-04-24 at 18 52
08@2x](https://github.com/user-attachments/assets/24e51250-4abc-4445-baa6-ea806417943f)
|
| ![CleanShot 2025-04-24 at 18 53
26@2x](https://github.com/user-attachments/assets/81e02807-4a38-440d-9740-f27dd0cf138f)
| ![CleanShot 2025-04-24 at 18 52
18@2x](https://github.com/user-attachments/assets/1a5be4ec-8322-4fbe-a20c-ec14a6472ba7)
|
| ![CleanShot 2025-04-24 at 19 57
43@2x](https://github.com/user-attachments/assets/296a00ca-926c-4b21-96f1-5d45853cc0d1)
| ![CleanShot 2025-04-24 at 19 57
09@2x](https://github.com/user-attachments/assets/cf0745c9-4753-4d70-ad97-4fb4e582fdaa)
|

---------

Co-authored-by: Yuriy Kurant <yuriy@discourse.org>
This commit is contained in:
chapoi
2025-05-12 11:28:12 +02:00
committed by GitHub
parent d932383cf8
commit 43872ac210
10 changed files with 400 additions and 416 deletions

View File

@ -82,6 +82,7 @@ export default class Results extends Component {
(and @inHeaderMobileView this.search.activeGlobalSearchTerm)
"with-search-term"
)
(if this.search.contextType "has-context")
}}
data-test-selector="search-menu-results"
>

View File

@ -141,59 +141,62 @@ export default class AssistantItem extends Component {
{{on "click" this.onClick}}
data-usage={{@usage}}
>
<a class="search-link" href={{this.href}}>
<a class={{concatClass @typeClass "search-link"}} href={{this.href}}>
<span aria-label={{i18n "search.title"}}>
{{icon (or @icon "magnifying-glass")}}
</span>
{{#if this.prefix}}
<span class="search-item-prefix">
{{this.prefix}}
</span>
{{/if}}
{{#if @withInLabel}}
<span class="label-suffix">{{i18n "search.in"}}</span>
{{/if}}
{{#if @category}}
<Category @result={{@category}} />
{{#if (and @tag @isIntersection)}}
<span class="search-item-tag">
{{icon "tag"}}{{@tag}}
<span class="search-item-wrapper">
{{#if this.prefix}}
<span class="search-item-prefix">
{{this.prefix}}
</span>
{{/if}}
{{else if @tag}}
{{#if (and @isIntersection @additionalTags.length)}}
<span class="search-item-tag">{{this.tagsSlug}}</span>
{{else}}
<span class="search-item-tag">
<Tag @result={{@tag}} />
{{#if @withInLabel}}
<span class="label-suffix">{{i18n "search.in"}}</span>
{{/if}}
{{#if @category}}
<Category @result={{@category}} />
{{#if (and @tag @isIntersection)}}
<span class="search-item-tag">
{{icon "tag"}}{{@tag}}
</span>
{{/if}}
{{else if @tag}}
{{#if (and @isIntersection @additionalTags.length)}}
<span class="search-item-tag">{{this.tagsSlug}}</span>
{{else}}
<span class="search-item-tag">
<Tag @result={{@tag}} />
</span>
{{/if}}
{{else if @user}}
<span class="search-item-user">
<User @result={{@user}} />
</span>
{{/if}}
{{else if @user}}
<span class="search-item-user">
<User @result={{@user}} />
</span>
{{/if}}
<span class="search-item-slug">
{{#if @suffix}}
<span class="label-suffix">{{@suffix}}</span>
{{#if (or @label @suffix)}}
<span class="search-item-slug">
{{#if @suffix}}
<span class="label-suffix">{{@suffix}}</span>
{{/if}}
{{@label}}
</span>
{{/if}}
{{#if @extraHint}}
<span class="extra-hint">
{{i18n
(if
this.site.mobileView
"search.mobile_enter_hint"
"search.enter_hint"
)
}}
</span>
{{/if}}
{{@label}}
</span>
{{#if @extraHint}}
<span class="extra-hint">
{{i18n
(if
this.site.mobileView
"search.mobile_enter_hint"
"search.enter_hint"
)
}}
</span>
{{/if}}
</a>
</li>
</template>

View File

@ -1,7 +1,7 @@
import Component from "@glimmer/component";
import { action } from "@ember/object";
import { service } from "@ember/service";
import FlatButton from "discourse/components/flat-button";
import DButton from "discourse/components/d-button";
import AssistantItem from "discourse/components/search-menu/results/assistant-item";
import User from "discourse/models/user";
import { i18n } from "discourse-i18n";
@ -53,11 +53,11 @@ export default class RecentSearches extends Component {
<div class="search-menu-recent">
<div class="heading">
<h4>{{i18n "search.recent"}}</h4>
<FlatButton
<DButton
@title="search.clear_recent"
@icon="xmark"
@action={{this.clearRecent}}
class="clear-recent-searches"
class="btn-flat clear-recent-searches"
/>
</div>

View File

@ -4,6 +4,10 @@
position: sticky;
top: 0;
z-index: z("header");
@include viewport.until(sm) {
z-index: z("mobile-header");
}
}
.d-header {

View File

@ -242,7 +242,7 @@
&.search-menu-panel {
width: 100vw;
max-width: 100vw;
padding: 0.5rem 0.5rem 0;
padding: 0;
transform-origin: 66%;
transition: height 0.2s ease-in;
@ -278,7 +278,7 @@
}
.btn-cancel-mobile-search {
padding: 1rem 0.625rem;
align-self: stretch;
}
}
}

View File

@ -7,25 +7,21 @@
@mixin separator {
border-top: 1px solid var(--primary-low);
margin-top: 0.5em;
padding-top: 0.5em;
}
$search-pad-vertical: 0.25em;
$search-pad-horizontal: 0.5em;
$search-result-element-padding: 0.35em 1rem; // hate myself but .25em is too tight and .5 too loose
.search-menu.glimmer-search-menu {
.search-input-wrapper {
@include breakpoint("mobile-extra-large") {
--search-input-wrapper-padding: 0.5rem;
position: fixed;
left: var(--search-input-wrapper-padding);
right: var(--search-input-wrapper-padding);
top: var(--search-input-wrapper-padding);
width: calc(100dvw - calc(var(--search-input-wrapper-padding) * 2));
padding-bottom: var(--search-input-wrapper-padding);
left: 1rem;
right: 0.35rem; // to compensate for cancel button padding
top: 0.5em;
padding-bottom: 0.5em;
background-color: var(--secondary);
z-index: z("base");
}
}
}
@ -40,7 +36,12 @@ $search-pad-horizontal: 0.5em;
display: flex;
align-items: center;
justify-content: space-between;
gap: 0.25rem;
.search-menu-panel & {
@include breakpoint("mobile-extra-large", $rule: min-width) {
padding: $search-result-element-padding;
}
}
}
.search-input {
@ -51,7 +52,7 @@ $search-pad-horizontal: 0.5em;
background: var(--d-input-bg-color);
border: var(--d-input-border);
border-radius: var(--d-input-border-radius);
padding: 0.25rem;
padding: 0.25em 0;
input.search-term__input {
background: none;
@ -66,19 +67,8 @@ $search-pad-horizontal: 0.5em;
}
@include breakpoint("mobile-extra-large") {
.mobile-search-button + input.search-term__input {
padding-left: 0;
}
}
.btn.search-context {
margin: 2px;
margin-right: 0;
white-space: nowrap;
background-color: var(--primary-200);
&:hover {
background-color: var(--primary-medium);
.mobile-search-button ~ input.search-term__input {
padding-inline: 0;
}
}
@ -87,18 +77,20 @@ $search-pad-horizontal: 0.5em;
}
}
@include breakpoint("mobile-extra-large") {
.btn.search-context {
margin: 0.25em 0 0 0;
padding: 0.25em 0.5em;
}
}
.menu-panel {
border: 0;
box-shadow: var(--shadow-dropdown);
padding: 0; // overrule generic menu panels to achieve full width hover effect
.heading {
padding: 5px 0 5px 5px;
@include breakpoint("mobile-extra-large", $rule: min-width) {
// alignment adjustment for search menu panel (within topic) on desktop to align with results
.search-input {
padding-right: calc(1rem - 0.65em);
}
.filter {
padding: 0 5px;
.search-term__input {
padding-left: 1rem;
}
}
}
@ -114,292 +106,57 @@ $search-pad-horizontal: 0.5em;
}
}
.search-context {
white-space: nowrap;
background-color: var(--primary-200);
@include breakpoint("mobile-extra-large", $rule: min-width) {
margin-left: 1rem;
margin-right: 0;
}
@include breakpoint("mobile-extra-large") {
position: fixed;
top: calc(var(--header-offset) + 0.75em);
left: 1rem;
padding: 0.25em 0.5em;
}
&:hover {
background-color: var(--primary-medium);
}
}
.results {
display: flex;
flex-direction: column;
border-radius: var(--d-border-radius);
&.with-search-term {
padding-top: $search-pad-vertical;
}
@include breakpoint("mobile-extra-large") {
&,
&.with-search-term {
padding-top: 3rem;
}
}
.list {
min-width: 100px;
.item {
.blurb {
// https://css-tricks.com/snippets/css/prevent-long-urls-from-breaking-out-of-container/
overflow-wrap: break-word;
word-wrap: break-word;
word-break: break-word;
hyphens: auto;
margin-top: 0.25em;
color: var(--primary-high);
font-size: var(--font-down-1);
}
}
}
.search-result-topic {
.first-line {
display: block;
line-height: var(--line-height-medium);
padding-top: calc(var(--header-offset));
}
.second-line {
display: flex;
flex-wrap: wrap;
align-items: baseline;
gap: 0 0.5em;
// temporary solution while waiting for dev to add conditional class
:has(.search-context) & {
padding-top: calc(var(--header-offset) + 2.25em);
}
}
.search-result-post {
.blurb {
font-size: var(--font-down-1);
}
}
.search-result-category {
.badge-category__wrapper {
font-size: var(--font-0);
}
.widget-link {
margin-bottom: 0;
}
}
.search-result-group .group-result,
.search-result-user {
.search-link {
display: flex;
align-items: center;
img.avatar {
margin-right: 10px;
}
}
.user-titles {
@include user-item-flex;
.name {
font-weight: 700;
}
.username,
.name,
.custom-field {
color: var(--primary-high-or-secondary-low);
}
.custom-field {
font-size: var(--font-down-2);
}
}
.user-result {
display: flex;
align-items: center;
font-size: var(--font-down-1);
}
}
.search-result-group .group-result {
display: flex;
gap: 0.5em;
align-items: center;
&:not(.--with-flair) {
svg {
padding: 0.43em; // matching avatar-flair width
background: var(--primary-200);
border-radius: 50%;
}
}
.d-icon {
font-size: var(--font-down-1);
}
.avatar-flair {
width: 1.62em;
height: 1.6em;
display: flex;
justify-content: center;
align-items: center;
background: var(--primary-200);
color: var(--primary-medium);
border-radius: 50%;
&.avatar-flair-image {
background-repeat: no-repeat;
background-size: 100% 100%;
}
.d-icon {
font-size: var(--font-down-2);
color: currentcolor;
}
}
.group-names {
@include user-item-flex;
min-width: 0;
.name,
.slug {
@include ellipsis;
}
&.--group-with-slug {
.name {
font-weight: 700;
}
}
}
}
.search-result-category,
.search-result-tag {
+ .search-result-user,
+ .search-result-group {
@include separator;
}
}
.search-result-user .user-result img.avatar,
.search-item-user {
display: flex;
align-self: center;
img.avatar {
width: 20px;
height: 20px;
margin-right: 0.5em;
}
.username {
margin-right: 0.33em;
}
}
.label-suffix {
color: var(--primary-medium);
margin-right: 0.33em;
}
.badge-category__wrapper + .search-item-tag {
display: flex;
align-items: baseline;
margin-left: 0.33em;
}
.search-item-tag {
color: var(--primary-high);
}
.extra-hint {
color: var(--primary-low-mid);
font-size: var(--font-down-1);
}
.search-item-slug {
overflow-wrap: anywhere;
white-space: wrap;
min-width: 0;
.keyword {
margin-right: 0.33em;
}
.badge-wrapper {
font-size: var(--font-0);
margin-left: 2px;
}
}
.search-menu-initial-options {
+ .search-result-tag,
+ .search-result-category,
+ .search-result-user,
+ .search-result-group {
@include separator;
}
}
.search-menu-initial-options,
.search-result-tag,
.search-menu-assistant {
.search-item-prefix {
margin-right: 0.33em;
}
.badge-category__wrapper {
font-size: var(--font-0);
}
.search-link {
display: flex;
flex-wrap: wrap;
align-items: baseline;
@include ellipsis;
.d-icon {
margin-right: 0.33em;
vertical-align: middle;
}
.d-icon-tag {
font-size: 0.7em;
}
.d-icon-magnifying-glass {
font-size: var(--font-down-1);
}
}
}
}
.browser-search-tip,
.search-random-quick-tip {
padding: $search-pad-vertical 1px;
font-size: var(--font-down-2);
color: var(--primary-medium);
.tip-label {
background-color: rgba(var(--tertiary-rgb), 0.1);
margin-right: 4px;
padding: 2px 4px;
display: inline-block;
border: none;
&.tip-clickable {
cursor: pointer;
}
}
}
.search-menu-recent {
@include separator;
.search-menu-assistant-item .search-link {
flex-wrap: nowrap;
}
.heading {
padding: 0.5em 0 0 1rem;
display: flex;
align-items: center;
justify-content: space-between;
.menu-panel & {
padding: 0.5em 0.5rem 0 1rem;
}
.filter {
padding: 0 5px;
}
h4 {
color: var(--primary-medium);
font-weight: normal;
@ -413,58 +170,46 @@ $search-pad-horizontal: 0.5em;
}
}
.browser-search-tip {
padding-top: 0.5em;
}
.searching {
display: flex;
align-items: center;
.spinner {
width: 0.75rem; // 12px
height: 0.75rem; // 12px
border-width: 0.125rem; // 2px
margin: 0 $hpad 0 0;
}
.show-advanced-search,
.clear-search {
.d-icon {
color: var(--primary-medium);
}
&:focus,
&:hover {
.d-icon {
color: var(--primary-high);
}
}
}
.clear-search {
padding-right: 0.25rem; // 4px
}
.show-advanced-search {
padding-left: 0.375rem; // 6px
}
}
.no-results {
padding: $search-pad-vertical $search-pad-horizontal;
}
.search-link {
display: block;
padding: $search-pad-vertical $search-pad-horizontal;
padding: $search-result-element-padding;
&.category,
&.user,
&.tag {
display: flex;
align-items: center;
flex-wrap: nowrap;
gap: 0.5em;
}
// This is purposefully redundant
// the search widget can be used outside of the header
// and the focus/hover styles from the header in those cases wouldn't follow
&:focus,
&:hover {
background-color: var(--highlight-bg);
background-color: var(--d-hover);
}
@include breakpoint("mobile-extra-large") {
padding-block: 0.5em;
}
.search-item-tag {
display: flex;
align-items: center;
gap: 0.25em;
color: var(--primary-high);
}
// overrules for legacy css
.topic-statuses {
float: none;
.topic-status .d-icon {
height: 1em;
width: 1em;
font-size: var(--font-down-1);
}
}
.topic {
@ -472,16 +217,254 @@ $search-pad-horizontal: 0.5em;
}
.topic-title {
font-size: var(--font-up-1-rem);
color: var(--tertiary);
overflow-wrap: anywhere;
margin-right: 0.25em;
}
}
.search-menu-initial-options,
.search-result-tag,
.search-result-user,
.search-result-category {
.search-link {
display: flex;
align-items: center;
gap: 0.5em;
}
}
.search-menu-initial-options {
+ .search-result-tag,
+ .search-result-category,
+ .search-result-user,
+ .search-result-group {
@include separator;
}
.search-menu-recent {
@include separator;
}
}
.search-result-category {
.badge-category__wrapper {
font-size: var(--font-0);
.badge-category {
gap: 0.5em;
}
}
.widget-link {
margin-bottom: 0;
}
}
.search-result-topic,
.search-result-post {
.search-link {
padding: 0.5em;
.list {
min-width: 100px;
.search-link {
padding-block: 0.5em;
}
.first-line {
display: block;
line-height: var(--line-height-medium);
}
.second-line {
display: flex;
flex-wrap: wrap;
align-items: baseline;
gap: 0 0.5em;
}
.item {
.blurb {
// https://css-tricks.com/snippets/css/prevent-long-urls-from-breaking-out-of-container/
overflow-wrap: break-word;
word-wrap: break-word;
word-break: break-word;
hyphens: auto;
color: var(--primary-high);
font-size: var(--font-down-1);
}
}
}
}
.search-result-group .group-result {
display: flex;
gap: 0.5em;
align-items: center;
&:not(.--with-flair) {
svg {
padding: 0.36em; // matching avatar-flair width
background: var(--primary-200);
border-radius: 50%;
}
}
.d-icon {
font-size: var(--font-down-1);
}
.avatar-flair {
width: 1.62em;
height: 1.6em;
display: flex;
justify-content: center;
align-items: center;
background: var(--primary-200);
color: var(--primary-medium);
border-radius: 50%;
&.avatar-flair-image {
background-repeat: no-repeat;
background-size: 100% 100%;
}
.d-icon {
font-size: var(--font-down-2);
color: currentcolor;
}
}
.group-names {
@include user-item-flex;
min-width: 0;
.name,
.slug {
@include ellipsis;
}
&.--group-with-slug {
.name {
font-weight: 700;
}
}
}
}
.search-result-category,
.search-result-tag {
+ .search-result-user,
+ .search-result-group {
@include separator;
}
}
.user-titles {
@include user-item-flex;
.name {
font-weight: 700;
}
.username,
.name,
.custom-field {
color: var(--primary-high-or-secondary-low);
}
.custom-field {
font-size: var(--font-down-2);
}
}
.user-result {
display: flex;
align-items: center;
font-size: var(--font-down-1);
}
.search-result-user .user-result img.avatar,
.search-item-user {
display: flex;
align-self: center;
gap: 0.5em;
img.avatar {
width: 20px;
height: 20px;
}
}
.label-suffix {
color: var(--primary-medium);
}
.extra-hint {
color: var(--primary-low-mid);
font-size: var(--font-down-1);
}
.search-item-slug {
overflow-wrap: anywhere;
white-space: wrap;
min-width: 0;
.keyword {
margin-right: 0.25em;
}
.badge-wrapper {
font-size: var(--font-0);
margin-left: 2px;
}
}
}
.search-random-quick-tip {
padding: max(0.5rem, 0.5em) 1rem;
font-size: var(--font-down-2);
color: var(--primary-medium);
.tip-label {
background-color: rgba(var(--tertiary-rgb), 0.1);
margin-right: 0.25em;
padding: 2px 4px;
display: inline-block;
border: none;
&.tip-clickable {
cursor: pointer;
}
}
}
.searching {
display: flex;
align-items: center;
.spinner {
width: 0.75rem; // 12px
height: 0.75rem; // 12px
border-width: 0.125rem; // 2px
margin: 0 $hpad 0 0;
}
.show-advanced-search,
.clear-search {
.d-icon {
color: var(--primary-medium);
}
&:focus,
&:hover {
.d-icon {
color: var(--primary-high);
}
}
}
}
.no-results {
padding: $search-result-element-padding;
}

View File

@ -55,10 +55,6 @@
margin: 0;
}
.browser-search-tip {
display: none;
}
.search-input {
.search-term__input {
min-width: 0;
@ -93,7 +89,9 @@
color: var(--primary-medium);
height: 100%;
position: absolute;
left: 0;
left: calc(
1rem - 0.65em
); // to align with result panel, minus padding of search icon btn
.rtl & {
right: 0;
@ -112,11 +110,11 @@
}
+ .search-menu-container .search-input {
padding-left: 1.75em;
padding-left: 2em;
.rtl & {
padding-left: unset;
padding-right: 1.75em;
padding-right: 2em;
}
}
@ -131,14 +129,10 @@
border-radius: var(--d-border-radius);
background: var(--secondary);
z-index: 9;
margin-left: auto;
margin-right: auto;
left: 0;
top: 100%;
right: 0;
@include float-down;
@include breakpoint(mobile-extra-large) {
width: 100%;
}

View File

@ -89,6 +89,7 @@ $z-layers: (
"overlay": 1200,
),
"fullscreen": 1150,
"mobile-header": 1150,
"mobile-composer": 1100,
"ipad-header-nav": 1020,
"header": 1000,

View File

@ -31,7 +31,7 @@
.floating-search-input {
width: 100%;
max-width: 550px; // half of defualt d-max-width
max-width: 550px; // half of default d-max-width
.search-banner {
height: 100%;
@ -80,10 +80,9 @@
.search-icon {
background: transparent;
padding: 0.25em;
pointer-events: none;
color: var(--header_primary-medium);
margin-left: 0.3em;
margin-left: calc(1rem - 0.65em);
height: 100%;
position: absolute;
z-index: 2;
@ -97,7 +96,7 @@
.search-input {
display: flex;
padding: 0 0 0 1.5em;
padding: 0 0 0 2em;
border-radius: var(--d-input-border-radius);
.search-term__input {
@ -118,7 +117,6 @@
display: none;
}
background: var(--secondary);
padding: 0.5em;
position: relative;
box-sizing: border-box;
width: 100%;

View File

@ -3050,7 +3050,7 @@ en:
in_messages_tooltip: "switch to searching regular topics"
in_topics_posts: "in all topics and posts"
enter_hint: "or press Enter"
mobile_enter_hint: "or tap Search icon"
mobile_enter_hint: "or tap Search"
in_posts_by: "in posts by %{username}"
recent: "Recent Searches"
clear_recent: "Clear Recent Searches"