-
Notifications
You must be signed in to change notification settings - Fork 715
[css-break-4] control space before element depending on page position #253
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
Comments
While I agree that this is a valid use case, this can already be achieved using the So, picking up the example (using a valid heading selector), you may want to use this: h2:first-of-type {
margin-top: 2em;
} Sebastian |
Sebastian - I don't think that's the case. Christin is talking about pages, so it's content in a fragmentation context. He likely has several headings in the document and wants the margin to apply to all of them except those whose start edge happen to be placed at the top of the fragmentation container. The :first-of-type pseudo-class knows only about parent elements and nothing about fragmentation. |
Hi Sebastian, thanks for pointing us to the issue tracker and for your first answer. I don't think that Say weh have the following structure:
and the following css snippet
The The Did this example made our point clearer? Regards, |
There's precedent for this in Antenna House Formater, and we are considering supporting it or something similar in Vivliostyle: https://www.antennahouse.com/product/ahf60/docs/ahf-ext.html#axf.margin-break
|
Yes, we should definitely add margin-break to css-break L2. :) Wrt the original use posted use case: the margin should disappear, unless there's a forced break specified. If there's a forced break specified, likely it's possible to select that element and also set its margin-top to zero! |
@frivoal Thanks for your post. I already know the ah-property -ah-margin-break. But unfortunately it doesn’t work in all case. Meaning, the setting works when heading is a "normal" (non floating) block element. But there are problems in rendering if the heading is a container for other structures like hcounter and hcontent and this elements are floating elements. In this case the setting doesn’t work correct. (I already sent a support mail to AH and they will fix it)
Yeah, it's nice to have proprietary css-settings. But, in my opinion it isn't a solution (in the long time view). Thus, it would be great to add a property (like margin-break) to W3C CSS spec (because the most renderer support the recommended CSS properties). This is the reason why I sent the request ... |
@christin-goetz I completely agree that this should be added to standard CSS, and that proprietary extensions are only a stop-gap measure. I was pointing at
Could you give more details about what problems you've run into with |
@frivoal The problem at the moment is that I get this rendering result if the heading is a container element (and I use AHFormatter)
How you see, the -ah-margin-break-property works correct for the first heading element at page. But the margin before the following heading (heading 3, red marked) is also discard. And this shouldn't be. That there is maybe a problem with the float I deduced from the case that the setting work well if my heading is a "normal" (simple) element
I think to add a CSS property like -ah-margin-break to CSS spec is a solution. If this property is supported by formatters and is rendered correct there are no further need instead ... |
@christin-goetz As far as I can tell, the problem you are talking about is a bug in AH's implementation, and if you "correctly" implement the property according to its documentation (https://www.antennahouse.com/product/ahf60/docs/ahf-ext.html#axf.margin-break), it wouldn't do that. Do you agree? |
@frivoal Yes, I agree. It seem to be a bug at AHFormatter (currently). I already sent a support mail to AH. |
We need to discuss this over our next F2F during TPAC. |
https://www.antennahouse.com/product/ahf60/docs/ahf-ext.html#axf.margin-break makes sense to me, except for the margin-block-end thing. This should only control margin-block-start. |
The CSS Working Group just discussed
The full IRC log of that discussion<gregwhitworth> Topic: fragmentation<gregwhitworth> fantasai: the suggested was to add a margin break property which controls how margin behaves at page breaks <astearns> github: https://github.com//issues/253 <gregwhitworth> fantasai: if you have to start a new fragmentation then the margin after it is preserved, for example a new margin heading <gregwhitworth> fantasai: if you're at an unforced break then it isn't preserved - this makes sense because margins are there to create space between things <gregwhitworth> fantasai: so this would allow you to keep or discard <gregwhitworth> fantasai: auto, keep, discard are proposed keywords in fragmentation L4 <gregwhitworth> fantasai: this is the only thing in that level <gregwhitworth> florian: this property exists in the antenna house formatter <gregwhitworth> Rossen: is there any discrepency on the type (columns, page, etc) <gregwhitworth> fantasai: no they all behave the same <gregwhitworth> jensimmons: I beleive this fixes one of the things that bugs me with multicolumn <gregwhitworth> fantasai: we would have to be clear that it would occur with the different fragmentainers <gregwhitworth> fantasai: there are different set of issues that are dealing with margins that aren't fragmented <gregwhitworth> TabAtkins: would this apply to general BFC? <jensimmons> rachelandrew: what’s the number of that bug? <gregwhitworth> fantasai: no <gregwhitworth> TabAtkins: to me that sounds like the thing that Jen just asked for <rachelandrew> 1939 <gregwhitworth> fantasai: we need to determine if it works with the first fragmentainer or not <jensimmons> This is the bug we need fixed. https://github.com//issues/1939 <florian> https://www.antennahouse.com/product/ahf60/docs/ahf-ext.html#axf.margin-break <gregwhitworth> gregwhitworth: and it's the same 1:1 scenario? <gregwhitworth> florian: yes <gregwhitworth> TabAtkins: I'm curious why they only allow after margin <gregwhitworth> fantasai: because the only option is keeping it because currently it's truncated <fantasai> s/truncated/always truncated/ <TabAtkins> s/only allow/only allow an optional 'keep' for/ <gregwhitworth> Rossen: this propety, if we bring it forward to fragmentation 4... <emilio> So, is `auto keep` a valid value? That sounds wrong <gregwhitworth> fantasai: we could also put it in box 3 or 4, etc <gregwhitworth> fantasai: there's little requested, this is currently the only thing <gregwhitworth> Rossen: any other opinions about margin break? <gregwhitworth> emilio: does it allow the auto keep value to be correct, because that's kind of weird <gregwhitworth> florian: I recommend we open an issue on that <gregwhitworth> emilio: sure <gregwhitworth> jensimmons: I don't want to bikeshed the name, but is margin-break the right name? <gregwhitworth> fantasai: we have margin-decoration-break as well so this carries that forward <TabAtkins> AH behavior: https://github.com//issues/253#issuecomment-229367559 <gregwhitworth> iank_: this only applies to forced breaks? <gregwhitworth> fantasai: this is expected to work on anything that has a margin <gregwhitworth> Rossen: ok, I'm hearing people are in favor for break L4 <TabAtkins> auto=discard on unforced breaks, keep on forced or start-of-container; discard=discard on all breaks; keep=keep on all breaks <gregwhitworth> Rossen: people can open issues against the proposal <gregwhitworth> Rossen: Objections? <gregwhitworth> RESOLVED: Add margin-break to break L4 <TabAtkins> end-side break is always discard right now, regardless of break type; option to specify "keep" for those too. <TabAtkins> <br dur=20min> <heycam> scribenick: heycam |
Checked in. Thanks very much for tracking this, @SebastianZ ! |
I just kicked off the discussion here on GitHub. Thanks to everyone providing valuable input and for adding Sebastian |
On 29 June 2016 at 09:25, Christin Götz | pagina GmbH wrote:
This was first posted to www-style.
Sebastian
The text was updated successfully, but these errors were encountered: