mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-11-28 16:26:04 +00:00
Implement dynamic font size adjustment for captions
Add script to adjust font size of enclosure captions based on article body font size.
This commit is contained in:
1 parent
9816279850
commit
bb78080f1f
1 file changed
+12
-1
@@ -14,4 +14,15 @@
|
||||
[[primary_media]]
|
||||
<div id="bodyContainer" class="articleBody [[text_size_class]]">[[body]]</div>
|
||||
[[enclosures]]
|
||||
</article>
|
||||
</article>
|
||||
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
const articleBody = document.querySelector(".articleBody");
|
||||
const textSize = parseFloat(getComputedStyle(articleBody).fontSize);
|
||||
|
||||
document.querySelectorAll(".nnw-enclosure-caption").forEach(enclosureCaption => {
|
||||
enclosureCaption.style.fontSize = `${textSize - 2}px`;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
Reference in new issue
Block a user