One question this is contingent on: does there exist a well-defined secure subset of CSS such that we don't have to worry about weird vulnerabilities?
* actually I think this was originally kogir's idea
These are absolutely basic things, and fixing them should not require individual users to fiddle with CSS – even on a website called "Hacker" News.
Myself and others with astigmatism literally cannot use "dark mode", tastefully done it's fine tho, talking stuff like Nord theme, monkeytype.com etc as long as it's not straight black and white.
I'd prefer HN adopted my styling, obviously. But a dark-mode toggle would be pretty straightforward.
There are sites which have permitted customising CSS for ages, with Old Reddit being among the m better-known cases. The use-case differs there in that a subreddit's moderator(s) specify the style used by other members, which isn't how you're suggesting HN be modified. People footgunning themselves is lower risk, though it might result in more support.
Another option would be to offer a closed set of vetted styles, or to parameterise some of the CSS values (e.g., font properties, colours, etc.)
There are a few S/E / S/O posts addressing your question, with few deep concerns, though both are 10+ years old.
"security issues with user-supplied CSS?"
<https://stackoverflow.com/questions/23502302/security-issues...>
"How dangerous is it to use CSS styles from an untrusted source?"
<https://security.stackexchange.com/questions/24163/how-dange...>
1: https://developer.mozilla.org/en-US/docs/Web/CSS/@media/pref...
https://addons.mozilla.org/en-US/firefox/addon/stylish/
https://chromewebstore.google.com/detail/stylish-custom-them...
edit I see you just answered another similar comment, but I'm still going to obstinately argue for it because it's the simplest and safest solution. There's nothing wrong with adding UI elements when you're adding new functionality. And that extra complexity is still less complex than something more superficially "elegant" like an internal CSS parser.
That leads to settings hell and I don't want that complexity curve.
I don’t know the answer, but if it is “no,” would it be feasible to add a few more user settings ala topcolor to achieve a more basic version of this?
Now, with dark mode able to being controlled by CSS media queries and also able to be done automatically according to system preferences, the complexity argument doesn't hold. It's less complex than the later-added comment collapsing behavior and navigation.
As things stand, some browsers (and, good news, those used by the overwhelming majority of desktop visitors) support CSS-management extensions such as Stylus.
But those don't work for all browsers, and aren't available in particular on Google Chrome/Android.
Firefox/Android does support Stylus, with some limitations: <https://old.reddit.com/r/firefox/comments/qgsqob/stylus_for_...>.
Apparently not for Safari / iOS: <https://github.com/openstyles/stylus/issues/299>
I've tweaked my own browser's default stylesheet in the past, and currently use a customised Reader View style for Firefox. Both are problematic, and changing the browser's default styling is probably best avoided these days. My Reader Mode view breaks somewhat and sometimes, but when it hits right, it's much better than stock.
I'm all for improvements to the theme, which have been overdue for a decade, but adding a dark variant is not the most pressing issue, to put it mildly.
[1] https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum...
[2] https://www.researchgate.net/publication/234578707_Optimal_L...
I also can't find a single ARIA attribute in the HTML code. Between that and the absence of semantic elements, I wonder whether screen reader users can navigate HN at all.
can add it as a custom filter.
It's very little work and has lots of benefits.
The free download buttons are in the middle of the page. There are also multiple links to the source code at the bottom.
I mainly read HN from an RSS reader, whose web view always shows light mode.
Modifying CSS on my machine for my viewing isn’t comparable to hacking a bank.
View the most recent 500 Hacker News articles in chronological order with all their first-order comments in view. Do not click to flip the page, do not click to see the comments.
Dark mode can come after that (some may want dark mode all the time, some may want it to obey system settings, some may want a simple toggle on every screen).
The reasons, well, could be added as comments here in the thread. Though, as you may imagine, it's mostly because of my eyes when I visit you guys without daylight.
And low contrast can also cause eye strain.