Hacker News new | ask | show | jobs
by uxp 2388 days ago
Do I have some weird rendering issue with this website, or do both of these snippets of code have terrible readability and highlighting? If I had to write code using an IDE or editor with this scheme I'd quit my career and go into small engine repair.

https://imgur.com/a/vS2EldV

7 comments

I'm pretty sure it's b.c. you have dark mode turned on & the CSS didn't consider code snippets.

Try turning them off, it'll look much better.

Thanks, it is better now but still not very good.
ui.systemUsesDarkTheme = 0 for FF users.
I use "widget.content.gtk-theme-override;Adwaita:light" to fix commonly invalid assumptions about default colors and appearances.

It overrides the GTK theme used to render page content and still allows to use a dark theme (or whatever you want) for UI components.

I think this is what it is supposed to look like: https://imgur.com/a/OHkBb8Q
Nope, it looks the same to me and I have a screen with high contrast and high brightness. Both his examples are very hard to read. And I have done color blindness tests and know I am not color blind.

Another thing: I think one thing he is missing is how important it is to see at a glance where function definitions are and where possible early returns are. The first example highlights def (function definitions), return (possible early return) and the return type (arguably not that important in most cases).

Sorry about that! I built dark mode after writing this post and it broke the main text color inside the `pre`s, which should have been #222. Should be fixed now.
hack to switch to light mode, if you don't want to do it systemwide (paste into console):

    Array.from(document.styleSheets).forEach(ss => Array.from(ss.rules).forEach((ssr,i) => {if (ssr.cssText && ssr.cssText.includes("dark")) {ssr.parentStyleSheet.deleteRule(i)}}))
That’s what it looked like for me. I thought maybe it looked illegible to me due to red-green color deficiency.
It’s a dark mode thing. Looks normalish with dark mode off.
Nope, I am not color blind and it is very hard to read for me too.
The text is black for me on my iPhone.
It might be a dark mode thing.

Edit: Yep, dark mode mangled the code snippets.

It is!