Restyle docs search results

This commit is contained in:
Richard Feldman 2024-11-29 02:18:20 -05:00
parent b456ee9592
commit aabef9dd48
No known key found for this signature in database
GPG key ID: DAC334802F365236
3 changed files with 49 additions and 49 deletions

View file

@ -43,13 +43,13 @@
.textContent.toLowerCase();
const entrySignature = entry
.querySelector(".type-ahead-signature")
.textContent.toLowerCase()
.replace(/\s+/g, "");
?.textContent?.toLowerCase()
?.replace(/\s+/g, "");
if (
totalResults < 5 &&
(entryName.includes(text) ||
entrySignature.includes(text.replace(/\s+/g, "")))
entrySignature?.includes(text.replace(/\s+/g, "")))
) {
totalResults++;
entry.classList.remove("hidden");

View file

@ -482,8 +482,9 @@ pre>samp {
}
#search-type-ahead {
font-family: var(--font-mono);
display: flex;
gap: 20px;
gap: 0px;
flex-direction: column;
position: absolute;
top: calc(var(--module-search-padding-height) + var(--module-search-height));
@ -501,20 +502,23 @@ pre>samp {
}
#search-type-ahead .type-ahead-link {
font-size: 0.875rem;
font-size: 1rem;
color: var(--text-color);
p {
line-height: 2em;
display: inline-block;
/* if it wraps, indent after the first line */
padding-left: 2em;
text-indent: -2em;
span {
margin: 0px;
}
p.type-ahead-def-name {
.type-ahead-module-name, .type-ahead-def-name {
color: var(--violet);
font-size: 1rem;
}
p.type-ahead-doc-path {
font-size: 0.75rem;
color: var(--faded-color);
}
}
#search-type-ahead li {
box-sizing: border-box;
@ -545,7 +549,7 @@ pre>samp {
}
#search-shortcut-key {
font-family: monospace;
font-family: var(--font-mono);
border: 1px solid #666;
border-radius: 5px;
padding: 1px 3px 3px;