Skip to content

[css-break-4] Should margin-break apply to elements or fragmentation containers? #3314

@bernhardf-ro

Description

@bernhardf-ro

In PDFreactor we have a property that works pretty much identically to margin-break (with a more convoluted name):
https://www.pdfreactor.com/product/doc_html/index.html#css-property-ro-truncate-margin-after-break
https://drafts.csswg.org/css-break-4/#break-margins

There is, however, one major difference: Our property applies to the fragmentation containers.

Our reasons for this were:

  • It avoids lists of selectors or universal selectors. .columcontainer instead of .columcontainer h1, .columcontainer h2, .columcontainer p or .columcontainer * and @page instead of html, body, h1, h2, p or *
  • It reduces complexity for both the implementers and authors. Nested break-adjoining elements with varying margin and margin-break values may result in hard-to-predict results, especially when the interaction with margin collapsing (e.g. in which order they are applied) is not obvious.

Of course, I understand that the finer granularity of the per-element approach may solve some complex cases, but, to be honest, I haven't been able to come up with any.

While we will, of course, implement the specification when it is mature, I would like to know your opinions on these two approaches.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions