From 3686c141356ca8ea1a87552e17d5e5fe9cc5b12c Mon Sep 17 00:00:00 2001 From: Javier Arce <4933+javierarce@users.noreply.github.com> Date: Sun, 1 Oct 2023 10:10:29 +0200 Subject: [PATCH] Test --- scripts/rss.reader.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/scripts/rss.reader.js b/scripts/rss.reader.js index cc183169b..2630bf1ff 100644 --- a/scripts/rss.reader.js +++ b/scripts/rss.reader.js @@ -6,10 +6,9 @@ class RSS extends HTMLElement { connectedCallback() { this.styles = document.createElement('style') this.styles.innerHTML = ` - rss-reader { display: block; margin: 0 0 0 0; } - ::part(blog), ::part(entry) { text-decoration: none; color: #ffc107; text-decoration: underline; } + rss-reader { display: block; margin: 0 0 1em 0; } + ::part(blog) { text-decoration: none; color: #ffc107; text-decoration: underline; } ::part(post) { opacity: 0; visibility: hidden; transition: opacity 250ms ease-in-out; } - ::part(entry) { text-decoration: underline; } ::part(date) { font-size: 0.8em; } rss-reader.is-loaded::part(post) { opacity: 0.4; visibility: visible; } ` @@ -24,7 +23,7 @@ class RSS extends HTMLElement { this.title = this.getAttribute("data-title") this.author = this.getAttribute("data-author") - const title = document.createElement('div') + const title = document.createElement('span') const blog = document.createElement('a') blog.textContent = this.title @@ -65,8 +64,11 @@ class RSS extends HTMLElement { entryDate.textContent = ago ? ` ${ago} ago` : '' entryDate.part = 'date' - entry.appendChild(entryDate) - this.shadow.appendChild(entry) + const titleElement = this.shadow.querySelector('span'); + titleElement.appendChild(entryDate) + + //entry.appendChild(entryDate) + //this.shadow.appendChild(entry) this.classList.add('is-loaded') }