Live data from Hacker News

Dark mode in a website with CSS

tombrow.com

31–40 of 191 posts

Re: Dark mode in a website with CSS

#31
post #5

I’m probably not representative of the general dark mode user, I think, but I enable dark mode because I want the UI chrome out of the way to concentrate on the content. I don’t want dark content. Is there a way to disable this media query?

In Firefox you can add "ui.systemUsesDarkTheme" as an integer in about:config and set it to "0" for forced light or "1" for forced dark. This setting changes what is reported by the media query, you can still set your OS and/or browser theme independently. You will need to restart Firefox to apply the setting.

Re: Dark mode in a website with CSS

#32
post #5

I’m probably not representative of the general dark mode user, I think, but I enable dark mode because I want the UI chrome out of the way to concentrate on the content. I don’t want dark content. Is there a way to disable this media query?

If you just want chrome to be dark, you can install a dark theme such as: https://chrome.google.com/webstore/detail/just-black/aghfnjk...

Re: Dark mode in a website with CSS

#33

I recently added dark-mode support to a few sites. It took way more time then I thought it would. At first I thought "oh just add a few lines off CSS" but then ... * Some diagrams had white backgrounds Solution: remove the backgrounds so they are transparent * Most diagrams had black lines/arrows which didn't look good on dark gray backgrounds Solution: use CSS filter:invert for images * Some images are photos not di…

>Solution: remove the backgrounds so they are transparent

This sucks when you want then share the diagram with someone, on certain platforms the diagram will be unreadable due to the lack of contrasting background.

Re: Dark mode in a website with CSS

#36
post #27

Earlier quoted context omitted.

I currently use 'DARK READER' for hacker news and it works quite well using the 'Filter+' theme engine.

The problem with browser extensions is that they're a massive security risk.

On some sites I've used it to get a good baseline then export the CSS and modify it from there.

Re: Dark mode in a website with CSS

#38
I love dark mode as a user, but as a developer it terrifies me how much complexity is involved in programming in 2019. At a stroke, it doubles the number of possible combinations of:

- 2 device sizes: desktop vs mobile (e.g. responsive)

- 3 platforms: web vs iOS vs Android, or web vs Windows vs macOS vs Linux (not even counting cross-browser or OS version quirks), or god forbid all of the above

- 2 input methods: hover/click/drag vs tap/hold/swipe

- 2 modes for accessibility: full visual+audio vs screenreader/captioned

- And now 2 visual modes: light vs dark

That's 48 combinations to design and test for. I'm probably forgetting some too. But as a developer it makes just the baseline cost of any basic app so damned high.

Again, as a user I love it. But the entrance cost for entrepreneurs, or even hobbyists? Man oh man.

Re: Dark mode in a website with CSS

#39
post #27

Earlier quoted context omitted.

The problem with browser extensions is that they're a massive security risk.

On some sites I've used it to get a good baseline then export the CSS and modify it from there.

How do you get your browser to even load custom CSS without an extension?

Re: Dark mode in a website with CSS

#40

> Photographs also looked harsh. It turns out that many people prefer images, too, to be desaturated in dark mode This is an interesting choice. While it might be easier on the eyes, personally it feels kind of icky to change colors on images…

Some global CSS themes change them, but then restore original ones on hover. Not perfect, but generally fine.

Though regular photos (and videos) are rarely so bright that it hurts the eyes while in a dark environment, unlike diagrams and other kinds of drawings, which can easily be mostly white.

Post reply on HN