3 ms·
I sometimes read hacker news with Emacs eww. An easy way to get dark mode. In Emacs-eww, the nested replies are rendered flat, not indented, but you can set up
by foobarbaz33 2y ago
I sometimes read hacker news with Emacs eww. An easy way to get dark mode.
In Emacs-eww, the nested replies are rendered flat, not indented, but you can set up a search on the "parent" hyperlinks. then search forward to move down the comment tree, or click the hyperlink to jump backup the tree.
When viewing in a modern browser a bit of javascript can make HN dark.
(function hackerNewsDarkMode() {
let bg = '#35352B';
let fg = '#EEEED1';
let tables = document.getElementsByTagName('table');
for (let i=0; i<tables.length; i += 1) {
tables[i].style.backgroundColor = bg;
tables[i].style.color = fg;
}
let codes = document.getElementsByTagName('code');
for (let i=0; i<codes.length; i += 1) {
codes[i].style.backgroundColor = '#300000';
codes[i].style.color = '#FF0000';
}
let spans = document.getElementsByTagName('span');
for (let i=0; i<spans.length; i += 1) {
spans[i].style.backgroundColor = bg;
spans[i].style.color = fg;
}
let a = document.getElementsByTagName('a');
for (let i=0; i<a.length; i += 1) {
a[i].style.backgroundColor = bg;
a[i].style.color = '#66CDAA';
}
let divs = document.getElementsByTagName('div');
for (let i=0; i<divs.length; i += 1) {
divs[i].style.backgroundColor = bg;
divs[i].style.color = fg;
// divs[i].style.color = '#FFC0CB';
}
let textAreas = document.getElementsByTagName('textarea');
for (let i=0; i<textAreas.length; i += 1) {
textAreas[i].style.backgroundColor = "#000000";
textAreas[i].style.color = fg;
}
// new case. comments now in a <div> with class commtext
let comments = document.getElementsByClassName('commtext');
for (let i=0; i<comments.length; i += 1) {
comments[i].style.backgroundColor = bg;
comments[i].style.color = fg;
}
document.body.style.backgroundColor = '#000000';
document.body.style.color = '#FFFFFF';
}());