refactor(command_palette): use CSS for styles

This commit is contained in:
Elian Doran
2025-07-27 15:44:47 +03:00
parent 126152ff63
commit 37461d0eb3
2 changed files with 27 additions and 11 deletions

View File

@@ -320,14 +320,15 @@ function initNoteAutocomplete($el: JQuery<HTMLElement>, options?: Options) {
suggestion: (suggestion) => {
if (suggestion.action === "command") {
let html = `<div class="command-suggestion">`;
html += `<div style="position: relative;">`;
html += `<span class="${suggestion.icon || "bx bx-terminal"}"></span> <strong>${suggestion.highlightedNotePathTitle}</strong>`;
html += `<div class="command-header">`;
html += `<span class="command-icon ${suggestion.icon || "bx bx-terminal"}"></span>`;
html += `<span class="command-name">${suggestion.highlightedNotePathTitle}</span>`;
if (suggestion.commandShortcut) {
html += ` <kbd>${suggestion.commandShortcut}</kbd>`;
html += `<kbd class="command-shortcut">${suggestion.commandShortcut}</kbd>`;
}
html += `</div>`;
if (suggestion.commandDescription) {
html += `<small style="color: var(--muted-text-color);">${suggestion.commandDescription}</small>`;
html += `<div class="command-description">${suggestion.commandDescription}</div>`;
}
html += '</div>';
return html;