mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-06 23:17:37 +00:00
Fix display of long items in search results
This commit is contained in:
parent
95978b302c
commit
0c10eb0b6a
@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
:root {
|
:root {
|
||||||
--nav-sub-mobile-padding: 8px;
|
--nav-sub-mobile-padding: 8px;
|
||||||
|
--search-typename-width: 6.75rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* See FiraSans-LICENSE.txt for the Fira Sans license. */
|
/* See FiraSans-LICENSE.txt for the Fira Sans license. */
|
||||||
@ -869,14 +870,11 @@ so that we can apply CSS-filters to change the arrow color in themes */
|
|||||||
gap: 1em;
|
gap: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-results > a > div {
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.search-results > a > div.desc {
|
.search-results > a > div.desc {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
flex: 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-results a:hover,
|
.search-results a:hover,
|
||||||
@ -884,6 +882,12 @@ so that we can apply CSS-filters to change the arrow color in themes */
|
|||||||
background-color: var(--search-result-link-focus-background-color);
|
background-color: var(--search-result-link-focus-background-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.search-results .result-name {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: start;
|
||||||
|
flex: 3;
|
||||||
|
}
|
||||||
.search-results .result-name span.alias {
|
.search-results .result-name span.alias {
|
||||||
color: var(--search-results-alias-color);
|
color: var(--search-results-alias-color);
|
||||||
}
|
}
|
||||||
@ -891,10 +895,14 @@ so that we can apply CSS-filters to change the arrow color in themes */
|
|||||||
color: var(--search-results-grey-color);
|
color: var(--search-results-grey-color);
|
||||||
}
|
}
|
||||||
.search-results .result-name .typename {
|
.search-results .result-name .typename {
|
||||||
display: inline-block;
|
|
||||||
color: var(--search-results-grey-color);
|
color: var(--search-results-grey-color);
|
||||||
font-size: 0.875rem;
|
font-size: 0.875rem;
|
||||||
width: 6.25rem;
|
width: var(--search-typename-width);
|
||||||
|
}
|
||||||
|
.search-results .result-name .path {
|
||||||
|
word-break: break-all;
|
||||||
|
max-width: calc(100% - var(--search-typename-width));
|
||||||
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.popover {
|
.popover {
|
||||||
@ -1730,6 +1738,16 @@ in source-script.js
|
|||||||
.search-results > a > div.desc, .item-table > li > div.desc {
|
.search-results > a > div.desc, .item-table > li > div.desc {
|
||||||
padding-left: 2em;
|
padding-left: 2em;
|
||||||
}
|
}
|
||||||
|
.search-results .result-name {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.search-results .result-name .typename {
|
||||||
|
width: initial;
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
.search-results .result-name .typename, .search-results .result-name .path {
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
|
||||||
.source-sidebar-expanded .source .sidebar {
|
.source-sidebar-expanded .source .sidebar {
|
||||||
max-width: 100vw;
|
max-width: 100vw;
|
||||||
|
@ -2024,9 +2024,11 @@ function initSearch(rawSearchIndex) {
|
|||||||
|
|
||||||
resultName.insertAdjacentHTML(
|
resultName.insertAdjacentHTML(
|
||||||
"beforeend",
|
"beforeend",
|
||||||
`<span class="typename">${typeName}</span>`
|
`\
|
||||||
+ ` ${item.displayPath}<span class="${type}">${name}</span>`
|
<span class="typename">${typeName}</span>\
|
||||||
);
|
<div class="path">\
|
||||||
|
${item.displayPath}<span class="${type}">${name}</span>\
|
||||||
|
</div>`);
|
||||||
link.appendChild(resultName);
|
link.appendChild(resultName);
|
||||||
|
|
||||||
const description = document.createElement("div");
|
const description = document.createElement("div");
|
||||||
|
Loading…
Reference in New Issue
Block a user