163 points · by funtoos · 4y ago · 113 comments
Two small examples:
"Show all text on the internet as black"
*##*:style(color: black !important)
"Show comment text on HN as bold" ycombinator.com##.comment:style(font-weight: bold !important)You can write entire sheets for all pages, multiple or single domains. For example to make HN legible (basic text, spacing and contrast):
@-moz-document domain("ycombinator.com") {
:root {
--font-size: 1.2rem;
--text-color: #333;
}
.comment {
font-size: var(--font-size);
line-height: 1.5;
}
body {
font-family: sans-serif !important;
font-size: 100%;
}
.comhead a:link,
.subtext a:visited,
.c00,
.c00 a:link,
td {
color: #333;
font-size: var(--font-size);
}
td {
background-color: transparent;
}
}(Personally I remove all fading from downvoted comments as well, they're unreadable)
https://chrome.google.com/webstore/detail/stylus/clngdbkpkpe... https://userstyles.org/
Unfortunately, Firefox on Android only supports a limited number of extensions, and Stylus is not currently one of them.
It's really sad, because I used to have some nice site-specific user styles.
I really don't understand Mozilla's decisions. They destroyed their password security, they destroyed their extension advantage. One wonders what's next — a pivot to Gopher? Oh well, despite all their numerous mistakes, Firefox is still preferable to Chrome.
(Last time I try, if you want to add an extension, you have to create a new collection and ... reinstall Firefox, but maybe that's just me.)
or stylish? https://robertheaton.com/2018/07/02/stylish-browser-extensio...
I rather use the one extension I can fully trust instead of installing additional ones
Right, that's why I didn't link to Stylish. uBO is great for blocklists but all my custom styles go in stylesheets eventually. You can use both (I do)!
One caveat is it's currently only supported in Safari technical preview.
Another thing worth mentioning is the relative brightness algo used in the repo for the linked plugin is using the WCAG 2 formula for relative luminance. This works pretty well in light mode for non-colored backgrounds, but doesn't incorporate perceived luminosity differences of different hues very well. A better algorithm to use here is the Advanced Perceptual Contrast Algorithm (APCA), which is the one used in the WCAG 3 working spec. It more accurately accounts for hue: https://github.com/Myndex/SAPC-APCA
filter: contrast(200%);
(200% is typically too strong.)
You can also go down in saturation like so:
filter: saturate(40%);
Or use both:
filter: saturate(40%) contrast(200%);
*##p:style(color:black !important; font-weight: normal !important;)
Hacker news will show the first line(s) of text gray and the rest black, because the first "paragraph" isn't wrapped in <p>.Maybe collect some common CSS framework techniques:
https://mui.com/material-ui/react-badge/#main-content
https://getbootstrap.com/docs/4.0/components/badge/
etc. They are apparently often called "badges" or "indicators" and so on.
Or on sites you visit regularly you can just inspect the source and look for specificity.
https://developer.chrome.com/blog/new-in-devtools-65/#overri...
hotwired.dev##p:style(font-family: "Jost", serif; !important)
Correct, nothing is, and your #000000 won’t be either once it’s shown on a physical screen.
[1] https://news.ycombinator.com/item?id=31421666
[2] https://news.ycombinator.com/item?id=31420938 (397 points by marban 1 day ago, 376 comments) - https://tangledweb.xyz/please-stop-using-grey-text-3d3e71acf...
There’s a massive difference between the contrast of that outdoors on a shitty panel (where you’re lucky to get 5:1 contrast) and indoors in a light-controlled environment (where 200:1 contrast is easily reached).
And yes, that 200:1 contrast can get painful, especially if you’ve got astigmatism.
There are knobs for these on most displays.
The thing about pure black isn't that it's unnatural, but that when paired with white its contrast can actually be uncomfortable and less accessible than a slightly toned down color combination (especially on full brightness).
Then turn down the brightness. Pure black/white should never be uncomfortable, if it is then your monitor needs adjusted. In fact I suspect a lot of this stupid low-contrast trend comes from designers who don't know that and are trying to compensate for it in software.
Monitors come with the brightness set ridiculously high so they'll look good in a showroom (and possibly to make the backlight wear out faster, but that's another rant...), but it's definitely not where normal use should be, unless you're in direct sunlight.
Can you find a citation for that statement? WCAG 2.1[0] mentions minimum contrast, but not maximum. The success criterion page itself is written in #000 on #fff. :)
https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum...
For those with fuzzy vision (obviously an extremely common situation), contrast is reduced naturally when the black and white bleed into each other. Reducing contrast harms those users, belying your "actually less accessible" assertion.
But hey, at least it had some contrast I guess?
That being said, it's easy using the prefers-contrast CSS property to override that to #000000 for people who are hard of sight.
It's supported by edge, safari, chrome, opera but it's a bit finnicky in Firefox.
Dark greys didn't have this effect.
I suspect a lot of these "dark grey text" conventions may be related to this hardware issue.
Edit: note this is per-subpixel, so you need to set some value in each color channel.
this comment reminds of the statement made by Jobs about the round corners in the physical world.
;)
1: http://www.beelinereader.com
2: https://chrome.google.com/webstore/detail/beeline-reader/ifj...
3: https://addons.mozilla.org/en-US/firefox/addon/beelinereader...
On the flip side, it is a great job candidate filter for design positions to show them a website and see if it's among the improvements they recommend.
I'm just hoping that sites with a fixed dark-mode design stay the minority because many of those that I've seen are horribly bad and literally hurt my eyes.
https://chrome.google.com/webstore/detail/darken-text/kmonkh...
On this site I get white text on medium brown, not as good as the standard colors for me at least.
- The Tailwind CSS framework’s popular “Prose” plugin defaults text colors to #374151.
- Years ago, designers told me that, for text on a white background, they recommended nothing darker than #333.
I find dark mode to help too. Not a black theme, a dark theme. Full contrast screen at its best.
I apologize for any intelligent discussion I may have caused.
https://www.amazon.com/dp/1875750223/
The research upheld the "any color as long as its black" popular wisdom for text, but found that black text on a ~15% tinted background (any color) did not impede readability. (Deeper background tints impeded readability.)
> Why is your monitor's maximum contrast the right value?
Please give me maximum contrast and let me adjust my monitor.