Giter Site home page Giter Site logo

Comments (13)

KeenRivals avatar KeenRivals commented on May 28, 2024 2

I agree that it can be done wrong. But #000 on #fff or the inverse is doing it right.

from bestmotherfucking.website.

Seirdy avatar Seirdy commented on May 28, 2024 2

White text on a black background causes halation, esp. for readers who have astigmatism. If you'd like a source on that: I have astigmatism and am a primary source. More seriously, there has been some experimental and plenty of anecdotal evidence.

I personally think that a background color of #0c0c0c and a foreground color of #eee is probably the maximum amount of b/w contrast that also balances accessibility.

There's a CSS media feature and client-hint for contrast preferences, called prefers-contrast. It takes no-preference, less, and more. You can serve increased-contrast pages to those who request more, and vice versa.

In addition to the contrast being too high for regular text, it's too low for link text. Rob Pike explains how color deficiency is nuanced and how blue on black can be especially tricky. The developers of the Advanced Perceptual Contrast Algorithm (APCA) for WCAG 3.0, the successor to the naive contrast algorithms used in WCAG 2.x, have treated blue as a "dark" color and yellow as a "light" one to account for how human eyes have fewer blue cones. Yellow/orange/green foregrounds stand out on dark backgrounds, and blue/purple foregrounds stand out on light backgrounds. It also takes into account the fact that small/thin text requires higher contrast.

Right now, the purple visited links have an APCA score of -63.5% and the blue links have a score of -77.86%. You should try to hit at least the mid-80s, preferably the mid-90s. Options to improve the score include:

  • Changing the hue to green/orange/yellow
  • Increasing the lightness
  • Increasing the font width
  • Increasing the font size

You can use the APCA by enabling it in Chromium's "experimental" pane in DevTools alongside the "CSS Overview" (if both aren't already enabled).

from bestmotherfucking.website.

KeenRivals avatar KeenRivals commented on May 28, 2024 1

from bestmotherfucking.website.

KeenRivals avatar KeenRivals commented on May 28, 2024 1

That research doesn't seem to carry a strong recommendation, and the w3c recommendation seems to be advocating a minimum level of contrast. From the research:

They collected data from a web site where they asked many subjects to rate the combinations of many different color combinations. Their general findings were: 1) Black and white were consistently rated as the most readable; 2) Color combinations that included black were rated more readable than those that did not; and 3) Darker text on lighter backgrounds were rated higher than lighter text on darker backgrounds.

1-3 there seem to advocate the use of black, either as a foreground or a background, though foreground is better. They mention edge cases where sometimes black on light gray or green on yellow rated better, but it depended on the font used.

There are very few experimental studies of readability of web pages, based on font/background colors (Hill and Scharff 1997). One exception is a series of two experiments conducted by Hill and Scharff (Hill and Scharff 1997, Hill and Scharff 1999). The results of these studies are consistent with the pre-web research in that higher contrast was generally found to be more readable. However, again, the relationship was far from perfect. For example, they found that green text on a yellow background and black text on a light gray background were both more readable than black on white in different experiments. Just to make matters more complicated, their results often differed as a function of font-type. So, for example, the readability of green on yellow mentioned above was primarily with times new roman, but was not as strong with aerial font.

In my case, I do not make choices about what font end-users get, so I think black on white is the best choice.

from bestmotherfucking.website.

jimcullenaus avatar jimcullenaus commented on May 28, 2024 1

black text on a light gray background [was] more readable than black on white in different experiments

This is the key part. While there is not an enormous body of research into this, what research there is seems fairly consistent. Black on light grey is better than black on white, and that the maximal extreme contrast is not ideal.

from bestmotherfucking.website.

fallingcats avatar fallingcats commented on May 28, 2024

@KeenRivals I am not sure I follow. You agree that there is a thing such as too much contrast, but absolutely white text on an a pitch back background does not qualify?

from bestmotherfucking.website.

jimcullenaus avatar jimcullenaus commented on May 28, 2024

#eeeeee on #111111 is so much easier on the eyes than pure white on pure black. This website is a lot better than number 2 in every other respect, but you're letting your personal uninformed opinion get in the way of creating a better website, when the actual research does not agree.

from bestmotherfucking.website.

KeenRivals avatar KeenRivals commented on May 28, 2024

Black and white were consistently rated as the most readable

from bestmotherfucking.website.

Seirdy avatar Seirdy commented on May 28, 2024

Another good overview on the issues with pure-white-on-black: https://uxmovement.com/content/why-you-should-never-use-pure-black-for-text-or-backgrounds/

from bestmotherfucking.website.

KeenRivals avatar KeenRivals commented on May 28, 2024

The site is using your browser's prefers-color-scheme setting. White text on black is happening because of that. I could certainly make it so a media query detects if you want less contrast, but looking through Firefox and Chrome and I don't see any way for a user to set that. I see layout.css.prefers-contrast.enabled in Firefox which looks related but nothing at all in Chrome.

The site you linked also says that pure black on white is easier to read for people with low vision. So by fixing the site for astigmatic users I might make it worse for that group of users. I don't think there is a good way for this site to be perfect for everyone. If you can think of a clever way to serve both needs I'd take a PR. Just keep in mind javascript is not allowed.

The link colors are unintentional. I have not styled them at all. That is something I should fix. It's a side effect of implementing a very simplistic dark mode. I made #63 so I can have the satisfaction of closing it via PR later.

from bestmotherfucking.website.

turtlegarden avatar turtlegarden commented on May 28, 2024

I find the site when prefers-dark is enabled to be nearly unreadable. Black on white is fine, but the inverse has too much contrast. Maybe a nice #1a1a1a could help ease halation.

from bestmotherfucking.website.

Offirmo avatar Offirmo commented on May 28, 2024

@KeenRivals I just discovered your site and thanks for enlightening me about strong contrast and linking to "contrast rebellion".

While I guess we all agree to a strong contrast, sites such as https://ianstormtaylor.com/design-tip-never-use-black/ advocate for slight greys. However looking at your site, your clear black on white is much crisper than https://perfectmotherfuckingwebsite.com/ (admittedly I have a quality screen)

I follow you in sticking on black/white 👍

from bestmotherfucking.website.

turtlegarden avatar turtlegarden commented on May 28, 2024

once again, on OLED displays it causes pixel delay on scrolling, obfuscating the text; it also causes halation.

from bestmotherfucking.website.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.