- 
                Notifications
    You must be signed in to change notification settings 
- Fork 194
Add CSS page breaking feature #331
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
Add CSS page breaking feature #331
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feels weird to have a feature about page break and to include values that are for multi-column breaks.
Also, no orphans and widows?
| @mstensho do you have thoughts on how to organize fragmentation features in a way that aligns with how web developers think about them and that roughly matches how browsers have evolved? | 
| The data there is certainly outdated, indeed. Chrome has supported the  Treating the three CSS properties ( The entry should be fragmentation type agnostic (printing / multicol), and should prefer referring to css-break (rather than css-multicol, css-page or CSS 2.1). What about orphans and widows? There is an entry for the orphans property: https://caniuse.com/mdn-css_properties_orphans , but no corresponding one for widows. There is a common "CSS widows & orphans" entry, though: https://caniuse.com/mdn-css_properties_orphans . Should all of this be merged into one "breaking feature", or would that be considered "too big"? | 
Co-authored-by: François Daoust <[email protected]>
| OK, I've made a few changes to this feature's ID, name, and description. That said, I have low confidence about what to name this. I couldn't find a lot of evidence that developers think about  | 
| @foolip asked me to generate the dist file, to see if it's reasonable—it was not. I've taken up a whole new approach: splitting page and column breaks. This tells a much more realistic story about you can and can't do with these properties. | 
| @@ -0,0 +1,15 @@ | |||
| name: Column breaks | |||
| description: The `break-after`, `break-before`, `break-inside` CSS properties control where columns start or end. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since break-after appears in the other description too, can you say something about the context this feature refers to? It's structurally similar to gap in grid and flex contexts, but I don't think we have good wording to copy from.
I think the context can be described as the use of columns or column-count.
| @@ -0,0 +1,18 @@ | |||
| name: Page breaks | |||
| description: The `break-after`, `break-before`, `break-inside` CSS properties (along with `page-break-` aliases) control where pages start and end. Also known as pagination or page breaking. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, I suspect there's no syntax to point to for context. But if this is only for printing, perhaps mention that?
| @@ -0,0 +1,15 @@ | |||
| name: Column breaks | |||
| description: In columnar layouts (created by the `columns` or `column-count` CSS properties), the `break-after`, `break-before`, `break-inside` properties control where columns start or end. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one does something a little funny, setting the context before describing the thing. It does make its description distinct from the other breaking feature though, which I think makes this in the spirit of the rule if not the letter of it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me!
| @@ -0,0 +1,18 @@ | |||
| name: Page breaks | |||
| description: The `break-after`, `break-before`, `break-inside` CSS properties (along with `page-break-` aliases) control where printed pages start and end. Also known as pagination or page breaking. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now specifies "printed" in the description.
| name: Page breaks | ||
| description: The `break-after`, `break-before`, `break-inside` CSS properties (along with `page-break-` aliases) control where printed pages start and end. Also known as pagination or page breaking. | ||
| spec: https://drafts.csswg.org/css-break-3/#breaking-controls | ||
| caniuse: css-page-break | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://caniuse.com/css-page-break says partial support across the board, except good old Presto of course. Can you add a comment about the difference and if there's anything we need TODO?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, this. Caniuse says everything is partially implemented. Some of this is just out-of-date (e.g., lack of support for break- properties)—I can open a PR against caniuse for that.
But because nothing is shown as being fully supported on caniuse except Presto, we can't be sure what Alexis meant by fully-supported. I've filed Fyrd/caniuse#7045.
The good news here is that I believe we still ought to show a positive status. If caniuse says partially supported, it's still equally partially implemented across all browsers. They seem to have the same set of limitations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The good news here is that I believe we still ought to show a positive status. If caniuse says partially supported, it's still equally partially implemented across all browsers. They seem to have the same set of limitations.
I spoke too soon. 😞
Alexis tested this again and showed that the avoid value is not consistently supported by browsers. I submitted mdn/browser-compat-data#22987 to update the BCD and changed the list of compat keys here to match caniuse.
This makes me think that the multicolumn breaks might also be broken, but I couldn't actually find bugs to that effect, so I'm letting that stuff stand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh my, things are rarely simple. I've reviewed and merged that PR.
| @mstensho do you think the state of this PR now makes sense, treating page breaks and column breaks as distinct features? | 
This came up in the course of defining page break features in web-features. caniuse reports partial support due to lack of support in Safari and Firefox. See also: - web-platform-dx/web-features#331 - Fyrd/caniuse#7045 (comment) - https://caniuse.com/css-page-break
This came up in the course of defining page break features in web-features. caniuse reports partial support due to lack of support in Safari and Firefox. See also: - web-platform-dx/web-features#331 - Fyrd/caniuse#7045 (comment) - https://caniuse.com/css-page-break
| 
 Works for me. | 
Corresponds to https://caniuse.com/css-page-break
This one is very messy. A quick tour of both the caniuse and MDN pages for these features suggests that the data here is out-of-date and/or disorganized. I'm fine with letting this feature through, but when we generate a status for it, I think we're in for some surprises and updating BCD.
This is a new feature. Here are some ideas for reviewing it: