[csswg-drafts] [mediaqueries] Add media queries for preferred caret width and blink rate (#10202)

dektar has just created a new issue for https://github.com/w3c/csswg-drafts:

== [mediaqueries] Add media queries for preferred caret width and blink rate ==
# Background:
## Blink rate:

Users with photosensitive seizure triggers and cognitive differences, such as focus disorders, want to be able to turn off the blinking text caret. These users may have difficulty using text fields with blinking text carets. Users on some operating systems, such as Mac and Windows, can change their caret blink rate and that setting can be respected by app developers, for example, Chrome/Edge and Firefox browsers on Windows read this user setting from the OS and are able to render text fields with the users’ preferred blink rate (in my own testing with Safari on Mac I was able to get the search bar only to respect the user’s [setting](https://discussions.apple.com/thread/7908738?answerId=31584236022&sortBy=best#31584236022), and Firefox on Mac did not seem to respect the user’s setting but it does have a config for ui.caretBlinkTime). However, for sites that render their own text caret (such as Canvas-based text editing apps), they are not able to discover or respect the user’s preference even when that preference is known by the browser.

## Width:
Users with low vision and vision loss often lose their text caret. It is also common for people who are using large displays to lose their text caret. Some users want to make the text caret thicker, which aids in visibility, and is a system setting on some operating systems and available as a config in some browsers. This setting, if it were to be exposed by the OS, could be respected by browsers for form controls, but cannot be respected for sites rendering their own text carets as they don’t have the required information about user preferences.

# Proposal:
We want to allow website developers who render their own text caret the ability to respect the user’s preferences for caret blink rate and width. This seems to make sense as a media query, similar to prefers-reduced-motion. I propose adding two media query items:

**prefers-caret-blink-rate**, which gives a number, in milliseconds, that the user would prefer. A blink rate of 0 indicates that the caret should not blink but should be steady-state on. Alternatively: prefers-caret-not-blink, which would be just a boolean of whether the caret should blink or not.

**prefers-caret-width**, which gives a number in pixels, that the user would prefer. I’m open to suggestions on the units; Major browsers appear to render the caret as 1 or 2 (density-independent) pixel wide regardless of font size.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10202 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 12 April 2024 17:44:44 UTC