Skip to content

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

@bernhardf-ro

Description

@bernhardf-ro

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions