Skip to content

[css-page] Default placement (text-align and vertical-align) of @page margins not useful in vertical writing modes #10421

@mstensho

Description

@mstensho

https://drafts.csswg.org/css-page-3/#margin-text-alignment has a table for a default UA stylesheet for @page margin boxes.

E.g. @top-left has text-align: left and vertical-align: middle, whereas its neighbor @top-center has text-align: center instead.

I suppose the defaults aren't that versatile in the first place, but it does make some sense, at least.

For instance:

  @page {
    size: 400px;
    margin: 100px;
    @top-left-corner { margin:3px; border:solid; content: "tlc"; }
    @top-left { margin:3px; border:solid; content: "tl"; }
    @top-center { margin:3px; border:solid; content: "tc"; }
    @top-right { margin:3px; border:solid; content: "tr"; }
    @top-right-corner { margin:3px; border:solid;  content: "trc"; }
    @right-top { margin:3px; border:solid; content: "rt"; }
    @right-middle { margin:3px; border:solid; content: "rm"; }
    @right-bottom { margin:3px; border:solid; content: "rb"; }
    @bottom-right-corner { margin:3px; border:solid;  content: "brc"; }
    @bottom-right { margin:3px; border:solid; content: "br"; }
    @bottom-center { margin:3px; border:solid; content: "bc"; }
    @bottom-left { margin:3px; border:solid; content: "bl"; }
    @bottom-left-corner { margin:3px; border:solid; content: "blc"; }
    @left-bottom { margin:3px; border:solid; content: "lb"; }
    @left-middle { margin:3px; border:solid; content: "lm"; }
    @left-top { margin:3px; border:solid; content: "lt"; }
  }
  body {
    background: #ddd;
  }

image

Although one could say that centering is somewhat dubious, given that most printers have some unprintable area near the paper edges, due to paper handling mechanisms, so that it might be better to push the margin boxes towards the page area, for vertical writing mode it gets really strange. If we add this:

  html {
    writing-mode: vertical-rl;
  }

image

Since text-align and vertical-align are logical properties (in spite of the latter having "vertical" in its name), it suddenly doesn't make any sense at all, and there's a huge risk of losing content due to unprintable areas.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Agenda+ LaterLower-priority items that are flagged for CSSWG discussioncss-page-3Current Work

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions