Skip to content

Commit

Permalink
chore: add badge to differentiate scaler types (#1432)
Browse files Browse the repository at this point in the history
  • Loading branch information
thisisobate authored Aug 7, 2024
1 parent ecb20bb commit 03a85e5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions assets/sass/style.sass
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,13 @@ hr
.section
padding: 4rem 1.5rem

.badge
border: 1px solid #dbdbdb
border-radius: 20px
padding: 3px 6px
color: blue
font-size: 1rem

.copyBtn
padding: 10px
background: none
Expand Down
4 changes: 4 additions & 0 deletions layouts/partials/javascript.html
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,14 @@
results.forEach(function (result) {
const doc = parse[result.ref];
const element = template.content.cloneNode(true);
element.querySelector(".badge").textContent = doc.type;
element.querySelector(".scaler-title").textContent = doc.title;
element
.querySelector(".scaler-title")
.setAttribute("href", doc.href);
doc.type === 'external' &&
(element.querySelector(".badge").style.color =
'purple');
doc.description &&
(element.querySelector(".description").textContent =
doc.description);
Expand Down
1 change: 1 addition & 0 deletions layouts/partials/scaler-template.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<div class="column is-half">
<div class="card">
<div class="card-content">
<p class="badge is-pulled-right"></p>
<a
class="title is-size-4 is-size-5-mobile has-text-primary has-text-weight-bold scaler-title"
>
Expand Down

0 comments on commit 03a85e5

Please sign in to comment.