mirror of
https://github.com/zadam/trilium.git
synced 2025-10-20 07:08:55 +02:00
refactor(command_palette): use CSS for styles
This commit is contained in:
parent
126152ff63
commit
37461d0eb3
@ -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;
|
||||
|
@ -1793,21 +1793,36 @@ textarea {
|
||||
background-color: var(--hover-background-color);
|
||||
}
|
||||
|
||||
.jump-to-note-dialog .command-suggestion kbd {
|
||||
.jump-to-note-dialog .command-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.jump-to-note-dialog .command-icon {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.jump-to-note-dialog .command-name {
|
||||
flex: 1;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.jump-to-note-dialog .command-shortcut {
|
||||
padding: 0.2rem 0.4rem;
|
||||
font-size: 0.8em;
|
||||
background-color: var(--button-background-color);
|
||||
border: 1px solid var(--main-border-color);
|
||||
border-radius: 3px;
|
||||
margin-left: 0.5rem;
|
||||
position: absolute;
|
||||
right: 1rem;
|
||||
top: 0.75rem;
|
||||
margin-left: auto;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.jump-to-note-dialog .command-suggestion small {
|
||||
display: block;
|
||||
.jump-to-note-dialog .command-description {
|
||||
margin-top: 0.25rem;
|
||||
font-size: 0.875em;
|
||||
color: var(--muted-text-color);
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user