Skip to content

Commit a83cc12

Browse files
Fix search result truncation to improve scannability (#6485)
- Truncate search result previews to 3 lines maximum - Improves user ability to scan and find relevant results quickly - Prevents display of entire page content (e.g., 900 words) in search results Signed-off-by: codeEvolveZenith345 <suntiwari3495@gmail.com>
1 parent 625de5f commit a83cc12

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

docs/stylesheets/extra.css

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -671,4 +671,26 @@ a.md-header__button.md-logo img {
671671
.pipe {
672672
display: none;
673673
}
674+
}
675+
676+
.md-search-result__article {
677+
max-height: none;
678+
}
679+
680+
.md-search-result__teaser,
681+
article.md-search-result__article p:not(.md-search-result__meta) {
682+
display: -webkit-box;
683+
-webkit-line-clamp: 3;
684+
-webkit-box-orient: vertical;
685+
overflow: hidden;
686+
text-overflow: ellipsis;
687+
line-height: 1.5;
688+
max-height: 4.5em;
689+
}
690+
691+
.md-search-result__article > p {
692+
display: -webkit-box;
693+
-webkit-line-clamp: 3;
694+
-webkit-box-orient: vertical;
695+
overflow: hidden;
674696
}

0 commit comments

Comments
 (0)