3 ms·
I was thinking of something like this: let style = document.createElement('style'); style.innerHTML = ".unread::after {content: ':bell:'}"; document.getE
by sorenjan 5y ago
I was thinking of something like this:
let style = document.createElement('style');
style.innerHTML = ".unread::after {content: ':bell:'}";
document.getElementsByTagName('head')[0].appendChild(style);
document.querySelectorAll('.athing.comtr').forEach(comm => {
if (comment is unread) {
comm.querySelector('.comhead').classList.add("unread");
}
})
That shouldn't collide with other custom CSS, and it avoids adding extra elements in the loop.
Edit: I used the actual bell emoji in the code, but HN removed that, so I just replaced it with :bell:.