Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/h-enk/doks.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/assets
diff options
context:
space:
mode:
authorMichael Schnerring <3743342+schnerring@users.noreply.github.com>2021-10-15 16:34:57 +0300
committerMichael Schnerring <3743342+schnerring@users.noreply.github.com>2021-10-15 16:34:57 +0300
commit1710b8082932e1e5f27c3c119cf25bcd794f9c2a (patch)
treecb13f7bbff3f4d2fba27b9bb8be9547b7b020b1f /assets
parenta409d55365839e4afd9e2d38e0ce826b0f914887 (diff)
Add descriptive class names for flexsearch result items
Diffstat (limited to 'assets')
-rw-r--r--assets/js/index.js2
-rw-r--r--assets/scss/components/_search.scss8
2 files changed, 6 insertions, 4 deletions
diff --git a/assets/js/index.js b/assets/js/index.js
index 61d9aa8..7f4bfcc 100644
--- a/assets/js/index.js
+++ b/assets/js/index.js
@@ -144,10 +144,12 @@ Source:
const title = document.createElement('span');
title.textContent = doc.title;
+ title.classList.add("suggestion__title");
a.appendChild(title);
const description = document.createElement('span');
description.textContent = doc.description;
+ description.classList.add("suggestion__description");
a.appendChild(description);
suggestions.appendChild(entry);
diff --git a/assets/scss/components/_search.scss b/assets/scss/components/_search.scss
index 6beebf2..7395004 100644
--- a/assets/scss/components/_search.scss
+++ b/assets/scss/components/_search.scss
@@ -43,12 +43,12 @@
font-size: $font-size-base;
}
-#suggestions span:first-child {
+.suggestion__title {
font-weight: $headings-font-weight;
color: $black;
}
-#suggestions span:nth-child(2) {
+.suggestion__description {
color: $gray-700;
}
@@ -61,7 +61,7 @@
display: flex;
}
- #suggestions span:first-child {
+ .suggestion__title {
width: 9rem;
padding-right: 1rem;
border-right: 1px solid $gray-200;
@@ -69,7 +69,7 @@
text-align: right;
}
- #suggestions span:nth-child(2) {
+ .suggestion__description {
width: 19rem;
padding-left: 1rem;
}