News for hackers. Stuff that matters.
Re:Hacker News needs a Dark Mode by cuttysnark on Thursday June 15, 2023 @11:46AM (#36342184)
If you're using ublock origin, I have these filters which I copied from another HN comment once upon a time.

news.ycombinator.com##html:style(filter:invert(100%) hue-rotate(180deg))

news.ycombinator.com##body:style(background: white)

news.ycombinator.com##div.toptext:style(color: black)

news.ycombinator.com###hnmain td[bgcolor="#000000"]

edit: "rules" -> "filters"

Re:Hacker News needs a Dark Mode by jmholla on Thursday June 15, 2023 @11:53AM (#36342303)
Note: These actually go under the filters tab of uBlock Origin, not the rules tab.
Re:Hacker News needs a Dark Mode by onetom on Thursday June 15, 2023 @12:01PM (#36342458)
i didn't know ublock can be used as a poor man's violent monkey :)

i can't read dark mode as well as light mode, but thanks for the advice!

Re:Hacker News needs a Dark Mode by SV_BubbleTime on Thursday June 15, 2023 @11:50AM (#36342250)
I’m an embedded dev, so websites and web tech are a black box to me… I’ve never asked, does the ## mean “overwrite” as uBlock DSL?
Re:Hacker News needs a Dark Mode by umvi on Thursday June 15, 2023 @11:56AM (#36342366)
> I’m an embedded dev, so websites and web tech are a black box to me

You should start tinkering with embedded webservers then (civetweb, etc)! Even embedded devs should learn web tech because often browsers are the easiest way to interface with router/modem settings, IoT settings, etc.

In this case "##" is uBlock filter syntax. Basically "news.ycombinator.com##html:style(filter:invert(100%) hue-rotate(180deg))" means "if the host matches news.ycombinator.com inject the following CSS"

Here's the docs if you want to rtfm: https://github.com/gorhill/uBlock/wiki/Dashboard:-My-filters

In this case I believe we are dealing with "cosmetic filters": https://github.com/gorhill/uBlock/wiki/Procedural-cosmetic-f...

Re:Hacker News needs a Dark Mode by dunham on Thursday June 15, 2023 @12:02PM (#36342492)
TIL that ublock lets you inject CSS. I've been using tampermonkey for that (most recently to fix the mspace tags on ncatlab.org).
Re:Hacker News needs a Dark Mode by hn92726819 on Thursday June 15, 2023 @12:44PM (#36343202)
> means "if the host matches news.ycombinator.com inject the following CSS"

Well I wouldn't word it like that.

    youtube.com##.ytp-cards-teaser
Hides elements with the selector ".ytp-cards-teaser", so ## doesn't represent "inject the followong CSS".

This is a helpful link: https://github.com/gorhill/uBlock/wiki/Introduction-to-basic...

## represents a cosmetic filter. Though I can't seem to figure out what #$# is still but I know that's also possible to use

Re:Hacker News needs a Dark Mode by BackBlast on Thursday June 15, 2023 @02:41PM (#36344815)
That rule set is pretty harsh. Can I recommend:

  news.ycombinator.com##body:style(background: black)
  news.ycombinator.com##td:style(color: #fafafa !important)
  news.ycombinator.com##table:style(background-color: #120F0D)
  news.ycombinator.com##div.toptext:style(color: #fafafa)
  news.ycombinator.com##span.c00:style(color: #fafafa !important)
  news.ycombinator.com##a:style(color: #ffa000 !important)
  news.ycombinator.com##span#karma:style(color: #faa000 !important)
  news.ycombinator.com##span.pagetop:style(color: #fafafa !important)
  news.ycombinator.com##textarea:style(color: #fafafa !important; background: inherit; )
  news.ycombinator.com###hnmain:style(background: #120F0D !important)
Re:Hacker News needs a Dark Mode by swifthesitation on Thursday June 15, 2023 @05:26PM (#36346715)
Oh wow, thank you for sharing; this is lovely!
Re:Hacker News needs a Dark Mode by calebj0seph on Thursday June 22, 2023 @12:47AM (#36428097)
Here's a dark mode stylesheet for Hacker News that I've been maintaining for a while as well: https://userstyles.world/style/1898/hacker-news-dynamic-dark

Just need the Stylus extension for your browser.

I've gone through every different feature on HN to tweak the colors, including details like down voted comment colors and obscure things like the special colors at Christmas.