rcarmo 7 days ago

Hmmm. Does that mean we'll get dark mode now?

7
yyx 6 days ago

uBlock origin filter:

    ! Hacker News dark mode
    news.ycombinator.com##html:style(filter:invert(90%) hue-rotate(180deg))
    news.ycombinator.com##body:style(background: white)

rcarmo 6 days ago

Does not work in embedded browsers in RSS readers. We need a proper site CSS, not client-side patches.

wvenable 6 days ago

Sounds like you need to write a CSS translating proxy server.

rcarmo 6 days ago

…and follow the HN pattern of adding more complexity to my own niche solution instead of fixing he technical debt? :)

Maybe I could fund a startup for that…

rcarmo 6 days ago

That thread is 5 years old, and nothing really came out of it.

The genius solution in there is probably this one:

     @media (prefers-color-scheme:dark){body{filter:invert(1) hue-rotate(180deg)}}
...which you can try by doing this in the browser console:

    const styleElement = document.createElement('style');
    styleElement.type = 'text/css';
    styleElement.textContent = "@media (prefers-color-scheme: dark) { html { filter: invert(1) hue-rotate(180deg); } }";
    document.head.appendChild(styleElement);

But I get that there are a lot of opinions. Just try one, put up a vote over a week, do it over 4-6 weeks, settle on the one that has the best feedback...

brudgers 6 days ago

That thread is 5 years old

This might be what we are up against:

https://norvig.com/21-days.html

https://paulgraham.com/hundred.html

rcarmo 6 days ago

I’m all for stability and all (heck, I still use vanilla vim), but some things are… necessary.

Tijdreiziger 6 days ago

I use the awesome “Dark Reader” browser extension, which gives you dark mode on any website.

rcarmo 6 days ago

Does not work in in-app browsers.

satiric 6 days ago

Considering Hacker News thinks font-size:9pt is acceptable for body text in 2025, don't hold your breath.

ashwinsundar 6 days ago

This is what cmd +/- is for

1718627440 6 days ago

I like it, in fact my standard terminal font size is even smaller. I hate all the modern websites wasting tons of whitespace, so that you need to hit C-- ~3 times to make it usable.

krior 6 days ago

whats wrong with that?

satiric 6 days ago

It's too damn small. Firefox automatically scales it up to 12px (as does Chrome I think), and even then I zoom in to 130% to get the font to 15.6px.

On the home page the text that tells you who the poster is, how many upvotes and comments, etc, is gray text on a gray background, at 7pt font. Again, Firefox and Chrome scale this up to 9.33pt, which again, is too small for me to read comfortably on a 24 inch desktop monitor without zoom.

(I accept that 120% would be fine; that brings up the main font size to 14.4pt. Wikipedia seems to use 14pt and that's totally fine for me. But still, neither me nor the browser should have to scale up the website.)

Even at 130% zoom, on the home page I can see 20 posts at once. I understand complaints that reddit went too far in the other direction, but that doesn't mean they should throw accessibility out the window for this site.

simoncion 6 days ago

> Firefox automatically scales it up to 12px...

Only if you've told it to. My Firefox settings have "Minimum Font Size" set to "None". Perhaps scaling up to 12px is a default? (Edit: Also, are you sure you're not thinking of 12pt? IIRC, points are DPI-independent units and (AIUI) the traditional way of specifying font sizes in computerized typography.)

Despite my age, I still have eyes that are good enough to easily read the font sizes you're complaining about. A hugely important part of a User Agent is that it provide overrides for site design choices that the Agent's user has decided will benefit them. It's a good thing that UAs let folks like you choose a minimum-possible font size. It's an equally good thing that UAs let folks like me choose to see the choices that designer made that others criticize.

chuckadams 5 days ago

Pixels are in fact DPI-independent too, the CSS spec makes them exactly 0.75 of a point, which comes out to 96 DPI regardless of the device. Devices are then free to scale that up or down as they like: phones typically scale it down a touch because they’re held closer to the eyes.

simoncion 5 days ago

What a bloody confusing way to define a unit of measure called a "pixel". 1px should be one device pixel, and 1pt should be 1/72 of an inch on the device!

Sheesh.

chuckadams 5 days ago

Eh, logical pixels have been a thing since at least X11, which is where we got that 96DPI thing to begin with. It certainly is confusing that they’re named the same thing though.

simoncion 6 days ago

> ...points are DPI-independent units...

To be clear, this is a confusingly- (and perhaps incorrectly-) worded way to say "At a given point size, a particular glyph from a particular font is supposed to be the same size on the output device, regardless of its physical size or number of pixels.".

satiric 6 days ago

Yup meant to say 12pt, sorry.

simoncion 5 days ago

Nothing to apologize for. I didn't even notice until a bit after I wrote up my reply. It has been several hot minutes since I've had to know the difference between the two.

rwmj 7 days ago

Can't you use tampermonkey or a similar tool that lets you apply your own stylesheet?

quotemstr 7 days ago

The OP isn't really asking for a "dark mode" like a literal reading of his comment might suggest. He's asking for an officially supported dark mode that evolves with the site and doesn't break random functionality one day. It's easy to use Stylist or TamperMonkey to make a dark mode that works at one instant of time. It's much harder to maintain one indefinitely in the face of constant changes made by developers not concerned with breaking your work, which they probably don't even know about.

SoftTalker 7 days ago

I think there was a vision early in the evolution of the web that user-supplied stylesheets would be a lot more commonly used than they turned out to be.

Things like colors, contrast levels, font sizes, are often matters of personal preference, and the browser (in theory) is the common place to manage those. Each site should not have to reinvent this feature.

galaxyLogic 6 days ago

User-style-sheets sound great in theory, but CSS is Cascading Style Sheets which means it would be very easy for users to break functionality of web-sites. For instance make the cascade cascade so that the text-color is same as background color on some widget on some website and you might be missing a button.

A user's custom style-sheet might be good for one web-site, but not for every website.

The original web was much about self-expression of developer-users, but now the web is all about apps, which must not break because a user might want to use different colors.

And why should you need to customize colors? I can understand that different users need larger fonts which you can do by zooming in the browser. Colors should be good to go if the website is well-styled to begin with.

quotemstr 6 days ago

> User-style-sheets sound great in theory, but CSS is Cascading Style Sheets which means it would be very easy for users to break functionality of web-sites. For instance make the cascade cascade so that the text-color is same as background color on some widget on some website and you might be missing a button.

Pretty sure AI-driven style derivation will finally deliver the dream of custom stylesheets in a robust and automatic way.

zzo38computer 6 days ago

> Colors should be good to go if the website is well-styled to begin with.

What if it is not well-styled? Or, maybe some people think it is and others disagree and want something else. The end user should need to customize fonts (not only larger, but also if you want smaller fonts; I more often find the fonts on a web page are too big and want smaller fonts; however, also you might prefer a specific font typeface and not only the font size), colours (also for many reasons, including using a monochrome display or printer that the web page author might not have been aware of), animations (e.g. to disable them), margins, etc.

zzo38computer 6 days ago

I think that being able to make user stylesheets based not only on HTML but also on ARIA attributes and on existing CSS commands, might be helpful, to compensate for the problems. User settings could also be used to e.g. override (and/or disable) the meaning of specific CSS commands in the styles specified in the document, and to override the results of media queries. It could also perhaps help to make the rendering more efficient if inefficient commands are disabled by the user (I often find it slow due to inefficient use of CSS commands).

quotemstr 6 days ago

> ARIA attributes

That works today. No problem.

    [role="button"] {
      cursor: pointer;
    }
> on existing CSS commands

Not sure what you mean. Between the new selector combinators and attribute selectors, you can do a ton. You also have style-based container queries, which are probably close to what you want.

johnisgood 7 days ago

It is possible to have this feature built-in to the browser. I am surprised it has not been implemented yet (?).

randallsquared 7 days ago

Browsers used to commonly support user stylesheets. Chrome removed it a long time ago, and I'm not sure what the status of that is in Firefox now. The issue is that there's no single common use case for them, and if there were, it would be simpler to build it in. But maintaining that level of flexibility has a continuing cost...

johnisgood 7 days ago

I am referring to the fact that there are more or less simple algorithms you can use to determine the dark version of colors, or rather, perceptually darker variants (e.g. APCA). The browser could make the contrast threshold configurable.

johnisgood 5 days ago

Oh, and there is inverse(), but I have no idea how good that is.

SoftTalker 7 days ago

Firefox appears to support a light and dark mode, custom foreground and background colors, and setting a default font face and size. Nothing like full user stylesheet support, at least not without extensions.

saint_yossarian 6 days ago

It does support the userContent.css file in the profile, there's just no UI for it.

shwouchk 6 days ago

safari still supports it on mac

altairprime 7 days ago

There was a Chrome experiment for it when I looked last year; it worked well in some cases and was just as bad at Google Sheets as every other generic darkmode solution.

vinceguidry 7 days ago

> Each site should not have to reinvent this feature.

This would send me into peals of laughter if I weren't already crying. The time to make this argument was 30 years ago, when the web wasn't fragmenting into a billion different pieces. The browser can make exactly zero assumptions about any given site, so it could never be a place where user preferences about them could be actionable. Downvoters should get work as web developers sometime. You really want the browser making assumptions about your web design?

All it can do is pass a header and let the website do what it will with it.

rcarmo 6 days ago

None of those extensions work in app-embedded browsers.

rcarmo 6 days ago

I don't read HN in normal browsers. If you read the RSS feed and click through, for instance, it's instant white flash from the embedded browser in the RSS reader, which cannot be customized but honors dark mode.

abdullahkhalids 6 days ago

Which RSS reader do you use?

rcarmo 6 days ago

Reeder on iOS, and Feeder(?) whenever I need to use an Android device. But _anything_ with an in-app browser will have the same issues.

jaoane 6 days ago

Disable the in-app browser I guess? If it doesn’t run extensions at all, are you not using an ad blocker? o_O

rcarmo 6 days ago

For HN? Why would I need that?

jaoane 6 days ago

I assume you use an RSS reader to read multiple feeds, not only HN.

cess11 6 days ago

There is an API somewhere, could wrap that with whatever you feel like.

rcarmo 6 days ago

That’s not really the point, my RSS reader’s in-app browser couldn’t deal with that.

justsomehnguy 6 days ago

Ask your browser for the reading mode

rcarmo 6 days ago

That does not prevent a big white flash in the middle of the night, and does not work inside all in-app browsers.