#8 - Added some classes for easy customization

This commit is contained in:
Simon Cambier
2022-04-12 19:45:59 +02:00
parent 02c19026b7
commit 8bc57c4362
2 changed files with 13 additions and 13 deletions

View File

@@ -1,17 +1,14 @@
.osresult__title {
.omnisearch-modal {
}
.omnisearch-result {
}
.omnisearch-result__title {
font-weight: bold;
}
.osresult__name {
padding-right: .5em;
font-size: small;
font-weight: normal;
color: var(--text-normal);
/* color: var(--text-muted);
text-decoration: underline; */
}
.osresult__body {
.omnisearch-result__body {
white-space: normal;
font-size: small;
word-wrap: normal;

View File

@@ -12,6 +12,8 @@ export class OmnisearchModal extends SuggestModal<ResultNote> {
super(plugin.app)
this.plugin = plugin
this.modalEl.addClass('omnisearch-modal')
this.setPlaceholder('Type to search through your notes')
this.setInstructions([
@@ -137,13 +139,14 @@ export class OmnisearchModal extends SuggestModal<ResultNote> {
renderSuggestion(value: ResultNote, el: HTMLElement): void {
el.setAttribute('data-note-id', value.path)
el.addClass('omnisearch-result')
// title
const title = el.createEl('div', { cls: 'osresult__title' })
const title = el.createEl('div', { cls: 'omnisearch-result__title' })
title.innerHTML = value.basename
// body
const body = el.createEl('div', { cls: 'osresult__body' })
const body = el.createEl('div', { cls: 'omnisearch-result__body' })
body.innerHTML = value.content
}