Skip to content

Commit fbdd2d1

Browse files
committed
Streamline autocompletion
1 parent 5a8ede7 commit fbdd2d1

File tree

5 files changed

+34
-49
lines changed

5 files changed

+34
-49
lines changed

assets/css/autocomplete.css

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@
7373
transition: var(--transition-colors);
7474
border-top: 1px solid var(--suggestionBorder);
7575
font-size: 0.9rem;
76+
overflow: hidden;
77+
text-overflow: ellipsis;
78+
white-space: nowrap;
7679
}
7780

7881
.autocomplete-suggestion.selected {
@@ -90,9 +93,13 @@
9093
font-weight: bold;
9194
}
9295

96+
.autocomplete-suggestion .separator {
97+
opacity: 0.4;
98+
margin: 0 2px;
99+
}
100+
93101
.autocomplete-suggestion .description {
94102
opacity: 0.6;
95-
padding-top: 3px;
96103
}
97104

98105
.autocomplete-suggestion .label {
@@ -107,17 +114,6 @@
107114
font-size: 0.7rem;
108115
}
109116

110-
.autocomplete-suggestion .header {
111-
margin-right: 5px;
112-
}
113-
114-
.autocomplete-suggestion .title,
115-
.autocomplete-suggestion .description {
116-
overflow: hidden;
117-
text-overflow: ellipsis;
118-
white-space: nowrap;
119-
width: 100%;
120-
}
121117

122118
@media screen and (hover: none) {
123119
.autocomplete-results .press-return {

assets/js/handlebars/templates/autocomplete-suggestions.handlebars

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,17 @@
1212
<div>
1313
{{#each suggestions}}
1414
<a href="{{link}}" class="autocomplete-suggestion" data-index="{{@index}}" tabindex="-1">
15-
<div class="title">
16-
{{# if deprecated }}
17-
<s><span class="header" translate="no">{{{title}}}</span></s>
18-
{{ else }}
19-
<span class="header" translate="no">{{{title}}}</span>
20-
{{/if}}
21-
22-
{{#each labels}}
23-
<span class="label">{{this}}</span>
24-
{{/each}}
25-
</div>
26-
15+
<span class="header" translate="no">{{{title}}}</span>
2716
{{#if description}}
28-
<div class="description" translate="no">
29-
{{{description}}}
30-
</div>
17+
<span class="separator" aria-hidden="true"> · </span>
18+
<span class="description" translate="no">{{{description}}}</span>
3119
{{/if}}
20+
{{# if deprecated }}
21+
<span class="label deprecated">deprecated</span>
22+
{{/if}}
23+
{{#each labels}}
24+
<span class="label">{{this}}</span>
25+
{{/each}}
3226
</a>
3327
{{/each}}
3428
</div>

0 commit comments

Comments
 (0)