Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Challenge accepted: https://github.com/prettydiff/hn_dark

The CSS works well for me, but I understand presentation is highly subjective and some people may not like it.

Perhaps more important is that tiny bit of JavaScript in the readme.md so that anybody can rapidly experiment with CSS themes for Hacker News on live pages with just copy and paste.

This was my first time to do a deep dive into the front-end code of Hacker News and the HTML is archaic. If you would like I can help spruce it up to modern 2008ish HTML code that is fully semantic, accessible, and much better for SEO. Just let me know how I can help.



You don't need JavaScript to experiment with CSS. Just open DevTools and experiment away.


This approach, if you tried it, is just a one time copy/paste to impose an entire theme change, such as swapping CSS files.

There isn't a cross-browser one step way to swap CSS files on live pages that I am aware of, especially if CSP is enabled as is the case with HN.


Open DevTools. Go to Sources. Click news.css. Paste in your own CSS.


Still not a one step solution and its a bit different cross browser. Its not a one step solution because you have to either modify an identifier in the page to support another additional template or completely throw the default colors away so that the new colors replace the default colors.

The little one line JavaScript code is literally copy/paste which allows for moving between pages and page refreshes and pressing up arrow then enter on the keyboard to reapply the theme change without manually reapplying a new stylesheet and/or modifying the DOM each time.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: