Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve support for invert colors and grayscale display mode (OS X and iOS) #74

Open
phiw13 opened this issue Jun 4, 2016 · 4 comments
Assignees
Milestone

Comments

@phiw13
Copy link

phiw13 commented Jun 4, 2016

(both accessible from the Accessibility preference panel on OS X)

2 media queries (supported by Safari so far):
@media (inverted-colors) {}
@media (monochrome) {}

see https://drafts.csswg.org/mediaqueries-4/#mf-colors

example (really really low-hanging fruit…):

@media (inverted-colors) {
    img { filter: invert(100%); }
}

In general I found CSS filters - saturate(), brightness() to be useful to improve the appearance on inverted mode – e.g. a light grey/blue/yellow might visually contrast enough on a white background, but is to weak to conformably discern when inverted. E { saturate (1.10); } could improve things.

(I haven’t tested Hive to see what is really needed… Just passing along experience following work on other projects)

@philwareham philwareham added this to the v4.7 milestone Jun 4, 2016
@philwareham philwareham removed this from the v4.7 milestone Dec 5, 2017
@philwareham
Copy link
Owner

Also, Dark Mode:

@media (prefers-color-scheme: dark) {)

@philwareham
Copy link
Owner

philwareham commented Nov 9, 2020

@phiw13 I guess we can bypass the inverted-colors MQ by simply making that use Dark Mode by default? Do you think that is a good compromise (I've tried to keep alll colours in Dark Mode within AAA contrast standards anyway)?

Monochrome is a different story. Will still need to investigate that more, if it's worth consideration (I have to admit I know little about how that relates to accessibility - I'll need to find some articles on it to read).

@phiw13
Copy link
Author

phiw13 commented Nov 10, 2020

monochrome is a bit problematic… The feature is useful e.g. for people who have some eye problems and want to avoid strong / lots of colours on a screen.
Unfortunately on macOS 10.15 and iOS 13 and later , this has moved from a checkbox under accessibility > display to a filter on the adjacent tab (colour filters). When turning the filters on and choosing grayscale however, the Media Query (monochrome) does not work in Safari - which was the only browser to support this MQ.

inverted-colors is something that is probably not much used anymore, now that system-wide dark mode is widely supported. That said, the prefers-color-scheme MQ and inverted-colors MQ are different animals (and the two OS options) and grouping them may lead to odd results… for example, the same colour sets are shared between both MQ’s – e.g a page with a dark background. If the user chooses the OS light mode and the OS inverted-mode option, the dark background will be white / light grey. The CSS is applied first and then the OS filter kicks in and invert everything on screen.

Note that for inverted-colors you do not need to bother with images, picture, video anymore. The default Safari stylesheet already take care of that issue (since Safari 12 I think).

@philwareham
Copy link
Owner

Thanks for the detailed explanation - very informative, as always.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants