w3c / w3c/csswg-drafts

[css-anchor-position][css-page] Suggestion for predefined anchor constants and paged media specific non-element anchors

Open
#8,301 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

css-anchor-position-2
Dominant language
Bikeshed
Stars
4.9k
Forks
816
PR merge metrics
PR metrics pending

Description

We think that Anchor Positioning could cover a use case we current have to provide a proprietary property for.
That use case is that in paged media it should be possible to position elements relative to the page.
To achieve that via anchors we propose two additions to the specification:

  1. The concept of predefined anchor constants, which can be unrelated to elements.
    The syntax could be an ident, without the two dashes, as it is explicitly CSS-defined not author-defined. However, we have no specific preference regarding this.

  2. Defining the following constants to refer to boxes of the first page that the absolutely-positioned element has boxes on:

  • page-content
  • page-padding
  • page-border
  • page-margin
  • page-trim
  • page-bleed
  • page-media

When the UA has no concept of trim, bleed and media, those should fall back to margin.
For non-paged media these anchors could either be not found or fall back to the root element or the view port.

see
https://drafts.csswg.org/css-anchor-position-1/#determining
https://drafts.csswg.org/css-page-3/#page-model

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

Read the determining section of css-anchor-position-1 and the page model in css-page-3 first. Evaluate how predefined anchor constants and the proposed page anchors would be specified, including the stated fallbacks, and confirm that the specification defines their behavior consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
css
Domain
frontend
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.