w3c / w3c/csswg-drafts

[css-scroll-anchoring-1] Explicit anchoring

Open
#4,264 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

css-scroll-anchoring-1
Dominant language
Bikeshed
Stars
4.9k
Forks
816
PR merge metrics
PR metrics pending

Description

The Scroll Anchoring module already allows to opt-out elements of the scroll anchoring algorithm via overflow-anchor: none;. And auto makes an element potentially eligible for anchoring. Though there is currently no way to enforce anchoring to an element.

The idea behind this is to allow the author to tell the user agent explicitly that it should prefer specific elements when running the anchor node selection algorithm. A use case for this are several content pieces, of which one is the main content.

To make this possible, there should be a new value like prefer for the overflow-anchor property.

Elements having this value set should be checked first by influencing the order in which the elements are checked in step 2 of the anchoring node selection algorithm.
It might also influence the candidate examination algorithm by preferring those elements over fully visible elements even when they are just partially visible.

Sebastian

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 Scroll Anchoring module, the overflow-anchor property definition, and the anchoring node selection algorithm referenced in the issue. Determine the specification changes needed for a prefer value and its selection behavior; done means the proposal is resolved in the draft with agreed algorithm text.

Written by the indexing model from the issue text.

Assessment

Tech stack
css
Domain
frontend, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.