Skip to content

Commit 92fa5d3

Browse files
committed
Improve styles of search results
1 parent 4dabde9 commit 92fa5d3

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

assets/css/style.scss

+16-3
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,29 @@ ul {
4747
&.search-results {
4848
list-style-type: none;
4949
margin: 0;
50-
padding: 0.5rem 0.75rem;
50+
padding: 0.5rem 0;
5151

5252
li a {
5353
display: block;
54-
padding: 0.3rem 0;
54+
position: relative;
55+
padding: 0.3rem 5rem 0.3rem 0.75rem;
56+
57+
&:hover {
58+
background-color: #fafafa;
59+
}
5560
}
5661

5762
.country {
63+
background-color: #eee;
64+
border-radius: 5px;
65+
color: #000;
66+
position: absolute;
67+
top: 5px;
68+
right: 0.75rem;
69+
font-size: 0.75rem;
70+
letter-spacing: 0.02rem;
71+
padding: .2rem .5rem;
5872
text-transform: capitalize;
59-
font-style: italic;
6073
}
6174
}
6275
}

index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ <h3 class="title is-4 mt-5">Rating definitions:</h3>
106106
const match = whiskyName.slice(matchIndex, matchIndex + query.length);
107107
const afterMatch = whiskyName.slice(matchIndex + query.length);
108108

109-
link.innerHTML = `${beforeMatch}<span class="highlight">${match}</span>${afterMatch} <span class="country">(${whisky.country})</span>`;
109+
link.innerHTML = `${beforeMatch}<span class="highlight">${match}</span>${afterMatch} <span class="country">${whisky.country}</span>`;
110110
} else {
111111
link.textContent = whiskyName;
112112
}

0 commit comments

Comments
 (0)