Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-break-4] Should margin-break: keep also keep the block-end margin before the break? #3254

Open
fantasai opened this issue Oct 26, 2018 · 5 comments

Comments

@fantasai
Copy link
Collaborator

fantasai commented Oct 26, 2018

Antenna House’s margin-break property takes two values, the second controlling whether the block-end margin is kept before the break. This raises some questions:

  • Do we want to add independent control over the block-end margin?
  • If that second value is omitted (or doesn't exist), is the block-end margin kept or truncated?
  • If the block-end margin is kept, this means that it affects the height of an auto-height fragmentainer in which it occurs. If the fragmentainer is fixed-height, does it also mean that the margin should not be truncated, and should force a break earlier in the page in order that it not be truncated?

CC @mstensho @dauwhe @MurakamiShinyu

@mstensho
Copy link

Regarding @fantasai's last bullet point: I see no value in forcefully keeping margins, and make it impossible to break inside of them. If a block-end margin doesn't fit, it should collapse into the fragmentainer boundary.

Therefore, I don't think we want/need to control block-end margin. As far as I understand the model, margins never cross fragmentainer boundaries. So whether you say that we put the portion of the margin that fits in the remaining space in the fragmentainer and truncate the rest, or we say that we just truncate the entire margin, the result will be the same. Right?

https://drafts.csswg.org/css-break-4/#break-margins currently gives some multicol examples where it appears to make a difference. Because of column balancing? I don't think we want that, because column balancing should ideally make the block size as small as possible, i.e. it shouldn't attempt to leave any room at all for margins at the end of the fragmentainer at all.

@MurakamiShinyu
Copy link
Collaborator

When I worked on Antenna House’s margin-break property, my idea was that the keep value for block-end margin is necessary when the block content is aligned to the block-end edge with the block-end margin kept intentionally. I still think it is useful.

@mstensho
Copy link

@MurakamiShinyu Could you elaborate a bit more on that? A use case / test case? Thanks.

@MurakamiShinyu
Copy link
Collaborator

I think there are may cases where we want to keep margin after the last block in a page. For example, when we want to make some special pages such as title page, colophon etc. in a book, and align the content of such page to block-end edge (align-content: end on the block-container) with some margin, the second keep value of the margin-break will be necessary.

@mstensho
Copy link

@MurakamiShinyu I think I need an actual testcase to understand this. align-content doesn't align the margin box, as far as I understand (and if it actually did include the margin box, we'd guarantee to make room for the margin at the end of the page anyway).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants