stacker.news icon indicating copy to clipboard operation
stacker.news copied to clipboard

dark mode requires javascript

Open adlai opened this issue 3 months ago • 8 comments

Is there an existing issue for this?

  • [x] I have searched the existing issues
  • [ ] I have read each one of the search results
  • [ ] I have explained why only one of them was considered irrelevant

Describe the bug

modern operating systems allow static pages to defer themeing to the user preferences.

disabling javascript increases power consumption [white background] unless specific additional actions taken to override default themes in ways that excessively reduce designer freedom [e.g. forcing "high contrast" mode]

the site's //*[@id="__next"]/footer/div/div[1]/span[1]/svg action seems to require javascript.

Screenshots

no

Steps To Reproduce

  1. find your chosen web browser's settings, either per-site or global
  2. disable javascript
  3. visit https://stacker.news
  4. pay your power bill

Expected behavior

website should not reduce my will to keep using it

Logs

No response

Device information

  • display: backlit liquid crystal
  • browser: any
  • extensions: none

Additional context

this is taking too long

adlai avatar Oct 02 '25 20:10 adlai

possibly relevant:

  • #1922 something about a11y
  • #833 something about security
  • ~#392 actua11y also about dark mode~
  • #390 also about dark mode
  • #379 surprisingly relevant for power consumption beyond simply kvetching about aesthetics
  • #33 seriously, it's a two-digit issue number, why bother

adlai avatar Oct 02 '25 21:10 adlai

I really don't want to rename the issue to "Could Dark Mode Work Without Javascript?", because closing it with "yes" doesn't fix the problem, and I do believe the site's general usefulness will be immeasurably improved by improving its support for clients that render statically.

adlai avatar Oct 31 '25 09:10 adlai

I do believe the site's general usefulness will be immeasurably improved by improving its support for clients that render statically.

I agree. I would love if Stacker News would serve only HTML and CSS and not require any Javascript, but since we are using React to render content, a Javascript framework, I don't see this as feasible any time soon, sorry.

We might be able to make dark mode work without JS, but the rest of the site will still not work, so I'm not sure how useful it is to make dark mode work without JS.

Maybe I'm wrong.

ekzyis avatar Oct 31 '25 09:10 ekzyis

#2501 is going to bring static content support via automatic HTML generation.

For now, like @ekzyis said, we're heavily JS-dependent and it's not a priority to become more independent. But static content is still something we are going to be able to do in the near future.

Soxasora avatar Oct 31 '25 09:10 Soxasora

Static content != no Javascript. I think @adlai means with "render statically" that there's no javascript required ~to render~ for anything.

ekzyis avatar Oct 31 '25 09:10 ekzyis

Yes, was just mentioning that the PR I referenced is going to create exportable HTML that we can serve in a no-JS environment.

But it doesn't mean that we can create the above-mentioned no-JS environment any time soon.

Still, I would like to keep this issue around because it's a good idea! I wonder how zaps would work in that case. Maybe an endpoint. It's already a lot to think about (lol)

Soxasora avatar Oct 31 '25 10:10 Soxasora

I don't mean that prefixing view-source: would turn SN into some financial projection of a blogosphere; I mean that someone could have reasonable expectation that the page loads once, and that represents the state of the noise up to N blocks ago. This N could be considered similar to the security parameter of Nakamoto Consensus, although rather than "security", you could call it something like "liveliness".

adlai avatar Oct 31 '25 13:10 adlai

no javascript required ~to render~ for anything.

that would be the gold standard; CSS that defers the scheming to the operating system and has light/dark defaults which work well enough that the neurotypical reader needs no client-side tweaking, and javascript only used for implementing interactions like zapping and posting.

adlai avatar Oct 31 '25 13:10 adlai