Skip to content

UX: Adjust inconsistent spacing in search drop down #33074

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions app/assets/stylesheets/common/base/search-menu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}

:root {
--search-result-element-padding: 0.5em 1rem;
--search-result-element-padding: 0.75em 1rem;
}

.search-menu.glimmer-search-menu .search-input-wrapper {
Expand Down Expand Up @@ -84,7 +84,10 @@
}

.menu-panel {
padding: 0; // overrule generic menu panels to achieve full width hover effect
padding: 0; // overrule generic menu panels to achieve full width hover
border: 1px solid var(--primary-low);
border-radius: var(--d-border-radius);
max-height: calc(100vh - var(--header-offset));

@include viewport.from(sm) {
// alignment adjustment for search menu panel (within topic) on desktop to align with results
Expand Down Expand Up @@ -135,7 +138,6 @@
display: flex;
flex-direction: column;
border-radius: var(--d-border-radius);
padding-top: 0.75rem;
Copy link
Member

@awesomerobot awesomerobot Jun 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this removes the space above the first result... more consistent with the welcome banner, but also doesn't look quite as nice to me, but maybe that's just my opinion

after:
image

before:
image

it also means the loading state regresses to an earlier issue where we have no space below the input while loading (easier to see this locally if you throttle your connection):

image


.heading {
padding: 0.5em 0 0 1rem;
Expand Down Expand Up @@ -166,6 +168,7 @@

.search-link {
padding: var(--search-result-element-padding);
font-size: var(--font-down-1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is making all of this stuff smaller intentional?

image

image

also the "more" link

image


&.category,
&.user,
Expand Down Expand Up @@ -285,7 +288,6 @@
word-break: break-word;
hyphens: auto;
color: var(--primary-high);
font-size: var(--font-down-1);
}
}
}
Expand Down Expand Up @@ -416,14 +418,14 @@
}

.search-random-quick-tip {
padding: 0 1rem 0.75rem;
font-size: var(--font-down-2);
padding: var(--search-result-element-padding);
font-size: var(--font-down-1);
color: var(--primary-medium);

.tip-label {
background-color: rgb(var(--tertiary-rgb), 0.1);
margin-right: 0.25em;
padding: 2px 4px;
padding: 0 4px;
Copy link
Member

@awesomerobot awesomerobot Jun 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tips look off-center vertically to me now

before:
image

after:
image

display: inline-block;
border: none;

Expand Down Expand Up @@ -461,4 +463,5 @@

.no-results {
padding: var(--search-result-element-padding);
font-size: var(--font-down-1);
}
4 changes: 0 additions & 4 deletions app/assets/stylesheets/common/components/welcome-banner.scss
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,6 @@
width: 100%;
}

.search-random-quick-tip {
padding-top: 0.75rem;
}

ul,
ol {
list-style-type: none;
Expand Down
7 changes: 0 additions & 7 deletions app/assets/stylesheets/desktop/components/header-search.scss
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,6 @@
z-index: 2;
}

.search-menu-panel {
padding: 0;
border: 1px solid var(--primary-low);
border-radius: var(--d-border-radius);
max-height: calc(100vh - var(--header-offset));
}

.search-input {
display: flex;
padding: 0 0 0 2em;
Expand Down
Loading