w3c / w3c/csswg-drafts

Browser zoom unit for accessibility [css-values-and-units]

Open
#6,869 62 comments 15 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

a11y-tracker css-fonts-5 css-values-5
Dominant language
Bikeshed
Stars
4.9k
Forks
816
PR merge metrics
PR metrics pending

Description

Currently all browsers scale the size of a pixel in order to zoom into a page by default. As a result, a zoomed in viewport is indistinguishable from a narrower viewport. This may result in unintended layout shifts as media queries are triggered as well as problems scaling responsive typography to be compatible with SC 1.4.4.

CSS authors need a way to identify zoom level so that we can create affordances for accessibility issues that may arise as a result of how zoom is currently implemented.

Two possible solutions:

  1. A CSS keyword value that is effectively a unitless scale factor and can be used in calc functions.
h1 {
  font-size: calc(6vw * zoom);
}
  1. Setting a standard for browsers to zoom the root font size instead of the size of a pixel. This will enable people to have finite control over what scales using relative units. Scale factor can be discovered with calc(1rem / 16px).
    Note: I don’t expect this to be an acceptable solution as the web has tried this and moved away from it to create a more consistent experience as many websites don’t use relative units.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the css-values-and-units context named in the issue and review its two proposed approaches for exposing browser zoom to CSS authors. No specific file or test is identified; done would require an agreed standard solution that addresses zoom-related layout and responsive typography concerns.

Written by the indexing model from the issue text.

Assessment

Tech stack
css
Domain
accessibility
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.