Move font sizing to CSS

This commit is contained in:
Justin Reeves authored and GitHub committed 2026-11-28 20:11:56 -06:00
1 parent 0f6c34c721
commit ec0b377949
1 file changed
+10 -59
+10 -59
View File
@@ -17,44 +17,18 @@
</article>
<script>
document.addEventListener("DOMContentLoaded", () => {
const articleBody = document.querySelector(".articleBody");
const textSize = parseFloat(getComputedStyle(articleBody).fontSize);
// macOS
if (!CSS.supports("-webkit-touch-callout", "none")) {
document.querySelectorAll("body > header .headerTable td, body > header .headerTable th").forEach(headerText => {
headerText.style.fontSize = `${textSize - 4}px`;
});
// iOS
if (CSS.supports("-webkit-touch-callout", "none")) {
document.querySelectorAll(".articleTitle h1").forEach(articleTitle => {
articleTitle.style.fontSize = `${textSize + 10}px`;
});
}
document.querySelectorAll(".nnw-enclosure-image img").forEach(img => {
// macOS
if (!CSS.supports("-webkit-touch-callout", "none")) {
document.querySelectorAll(".articleTitle h1").forEach(articleTitle => {
articleTitle.style.fontSize = `${textSize + 12}px`;
});
}
document.querySelectorAll(".articleDateline").forEach(articleDate => {
articleDate.style.fontSize = `${textSize - 2}px`;
});
document.querySelectorAll(".articleDatelineTitle").forEach(dateTitle => {
dateTitle.style.fontSize = `${textSize - 0}px`;
});
document.querySelectorAll("div.externalLink").forEach(externalLink => {
externalLink.style.fontSize = `${textSize - 4}px`;
});
document.querySelectorAll(".nnw-enclosure-caption").forEach(enclosureCaption => {
enclosureCaption.style.fontSize = `${textSize - 2}px`;
});
});
const a = document.createElement("a");
a.href = img.src;
img.replaceWith(a);
a.append(img);
});
}
</script>
<script>
@@ -75,27 +49,4 @@ if (feedLink.href.includes("https://www.propublica.org/")) {
img.sizes = img.sizes.split(",").slice(1).join(",").trim();
});
}
// blog.the-ebook-reader.com
if (feedLink.href.includes("blog.the-ebook-reader.com")) {
document.querySelectorAll(".nnw-primary-media").forEach(div => {
div.style.display = "none";
});
}
</script>
<script>
// macOS
if (!CSS.supports("-webkit-touch-callout", "none")) {
document.querySelectorAll(".nnw-enclosure-image img").forEach(img => {
const a = document.createElement("a");
a.href = img.src;
img.replaceWith(a);
a.append(img);
});
}
</script>