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

I suggest this:

No `env()`.

Add a descriptor that applies in page and margin contexts. In page contexts it will be meaningful for all four margin sides. For margin contexts it will only be meaningful for the sides that are adjacent with a paper edge (that's two sides for corner page-margin boxes, and one side for the other 12 page-margin boxes along the paper edges). It is better to allow it to be specified inside `@page` margin rules (and directly inside `@page` as well), rather than only directly inside `@page` (and let it control all page-margin boxes or something), since we most likely want to control it individually for each page-margin box.

This descriptor may be a shorthand for four / eight other descriptors, if we want to control each edge independently. Do we?

Descriptor name: `page-margin-safety`?

Values: `none` (initial), `clamp`, `additive`?

Yes, after some contemplation, I think we want both clamping and adding. That's more ergonomic. That said, most cases can be solved with adding (just set `margin` to 0, and "add" the safe inset, if you don't want to any additional offset besides the safe inset). One case that cannot be solved with adding, though, is if margins are unspecified and we use the browser defaults. Maybe those should really always keep us within the printable area, but adding a safe inset to browser default margins feels strange. `none` or `additive` makes sense together with default margins, though.

WDYT?

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


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

Received on Wednesday, 10 September 2025 22:17:53 UTC