3 ms·
Quick fix for the font, which many people are (rightly) complaining about. Array.from(document.getElementsByClassName("quote")).forEach(p => { p.style.margin
by latexr 3mo ago
Quick fix for the font, which many people are (rightly) complaining about.
Array.from(document.getElementsByClassName("quote")).forEach(p => { p.style.marginTop = "20px"; p.classList.remove("quote", "reveal") })
The issue is that all of the text is a quote, and that renders enormous. That’s probably fine for a tiny quote amongst more text, but here it is jarring.
- silverlimetea 3mo agoquerySelectorAll('.quote')
- deleted 3mo ago[deleted]
- Cyberdog 3mo agoquerySelector/querySelectorAll() are great for plucking out deeply nested elements but if all you need is to find all elements of a certain class and the API gives you a tool to do exactly that, why not do that instead of reaching for the general-purpose Swiss army knife? Sure, the execution speed difference may be only measurable in microseconds, but it takes about the same amount of time to type so why not use the specific tool?
- silverlimetea 3mo agoThis is the specific tool. Wrapping it in Array.from is the extra step. The Array-like already works for forEach and for .. of