Rollup merge of #112720 - poliorcetics:rustdoc-item-type-color-same-as-item-color, r=notriddle,GuillaumeGomez

Rustdoc: search: color item type and reduce size to avoid clashing

- rustdoc: search: color item type same as item
- rustdoc: search: reduce item type size to 0.875rem to avoid clashing with path and item
This commit is contained in:
Guillaume Gomez 2023-06-20 14:23:39 +02:00 committed by GitHub
commit a318824b43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 1 deletions

View File

@ -890,6 +890,10 @@ so that we can apply CSS-filters to change the arrow color in themes */
.search-results .result-name .grey {
color: var(--search-results-grey-color);
}
.search-results .result-name .typename {
color: var(--search-results-grey-color);
font-size: 0.875rem;
}
.popover {
position: absolute;

View File

@ -2024,7 +2024,9 @@ function initSearch(rawSearchIndex) {
resultName.insertAdjacentHTML(
"beforeend",
`${typeName} ${item.displayPath}<span class="${type}">${name}</span>`);
`<span class="typename">${typeName}</span>`
+ ` ${item.displayPath}<span class="${type}">${name}</span>`
);
link.appendChild(resultName);
const description = document.createElement("div");

View File

@ -28,6 +28,12 @@ define-function: (
".result-" + |result_kind| + ":focus ." + |result_kind|,
{"color": |hover_color|},
)
// color of the typename (struct, module, method, ...) before search results
assert-css: (
".result-name .typename",
{"color": "#888"},
ALL,
)
},
)