Skip to content

Commit

Permalink
feat: highlight exact match package
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreDemailly committed Dec 7, 2024
1 parent 242b273 commit 6cae127
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions public/components/views/search/search.css
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@
padding-left: 5px;
}

.result.exact {
background: #f4fff2 !important;
}

.result:nth-child(even) {
box-shadow: 1px 1px 10px #33333314 inset;
}
Expand Down
3 changes: 3 additions & 0 deletions public/components/views/search/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ export class SearchView {
for (const { name, version, description } of result) {
const divResultElement = document.createElement("div");
divResultElement.classList.add("result");
if (packageName === name) {
divResultElement.classList.add("exact");
}

const pkgElement = document.createElement("div");
pkgElement.classList.add("package-result");
Expand Down

0 comments on commit 6cae127

Please sign in to comment.