Re: [csswg-drafts] [css-page] Expose unprintable areas via CSS (#11395)

New proposal, then. Let's get rid of the `page-safe-margin` alias, and let `@supports` / `@supports-condition` handle that.

Also update the wording regarding non-uniform unprintable area width. If the application can be absolutely positive that the information from the printer is correct, and that we're not affected by any funny rotation or long-edge vs-short-edge feeding secrets, the spec shouldn't prevent the application from applying different (and correct) safety insets per paper side.

## Proposal

Add a property / descriptor (the spec seems confused about this terminology) for `@page` and `@page` margin boxes:

Name: `page-margin-safety`
Value: `none` | `clamp` | `add`
Initial: `none`

The spec text could be something like:

> Most printers have a small region along each edge of the page sheet which is unprintable, typically due to the printer's paper handling mechanism. See https://drafts.csswg.org/css-page-3/#page-terms
>
> `page-margin-safety` can be used to make sure everything ends up within the printable area, by adjusting the page margins.
>
> Some printers don't have a uniform unprintable area width along each of the four paper edges, and the printer may rotate the print output at their own discretion. The user agent may therefore not be able to make assumptions about which edge will be fed first into the printer, or what orientation the sheet of paper has. If the user agent cannot make such assumptions, only one value can reliably be provided here (to be used on all 4 sides): The larger of these four values. Otherwise, if the user agent *can* trust that the four values are usable individually, and that no rotation is going to take place and so on, each side of the page may have individual values.
>
> Let this value be `<safe-printable-inset>`, which is a `<length>`.
>
> If `page-margin-safety` is `none`, `<safe-printable-inset>` has no effect. If it is `clamp`, the used margin values on each side will be the maximum of computed value and `<safe-printable-inset>` for the given side. If it is `add`, the used margin values will be computed value plus `<safe-printable-inset>` for the given side.
>
> `page-margin-safety` only affects margins that are adjacent to a page's edges. In other words, when `page-margin-safety` is specified in a margin context, it will only have an effect at one or two sides. For instance, `@page { @top-right-corner { page-margin-safety: clamp; } }` may only clamp top and right margin values, as the bottom and left margins face the document's contents, not the page's edges.

`page-margin-safety` could also be seen as a possible shorthand for `page-margin-safety-top`, `page-margin-safety-right`, `page-margin-safety-bottom`, and `page-margin-safety-left` (+ the logical properties too), just like `margin` is a shorthand. But I suggest that we wait with this.

-- 
GitHub Notification of comment by mstensho
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/11395#issuecomment-3546009354 using your GitHub account


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

Received on Tuesday, 18 November 2025 07:53:06 UTC