-
Notifications
You must be signed in to change notification settings - Fork 719
[css-inline-3] initial-letters: interaction of shape-margin and regular margin #5119
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
Maximum of the two values. The content-box size (and consequently the margin box size) is not influenced by |
Actually, thinking about this more... we've got several options here:
Only honoring (The additive option, having CC @dauwhe |
I think it's better to have an interaction between the properties rather than a switch where we only use one or the other. I think using the maximum is reasonable. Another possibility is to make things consistent with how shapes and margin boxes in floats interact - the shape described by shape-outside and shape-margin is clipped to the margin box. It's a bit weird for authoring, but once you learn how things are implemented for floats your knowledge would carry over to initial-letter. |
We've tried implementing Alan's suggested approach, and there's a slight problem. The spec states that when using Consider this: p::first-letter {
initial-letter: 3 3;
initial-letter-wrap: all;
shape-outside: 10px;
margin-right: 20px;
} The black "G" is the actual letter. The I think the best solution would be to not add the end margin+padding+border to the shape - i.e. remove "plus the amount of the initial letter’s end-side border+padding+margin." from the definiiton of In other words: the margin sets the margin-box, and does nothing else. The letter shape is expanded by This would be a change to the current functionality, but - as Webkit hasn't implemented I've put a demo of of the implementation as described in this comment at https://bfo.com/publisher/?saved/18c0fb7cb6c548f5#svg Edit: one consequence of this - currently you can set a negative margin to overlap the text. But |
Having shape-margin work exactly the same between floats and initial-letter seems like a good result to me. |
The CSS Working Group just discussed
The full IRC log of that discussion |
@astearns / @faceless2 Mind reviewing the edits to make sure I got them right? 6b1e2a2 |
That change LGTM, thanks! |
@fantasai I'd put a paragraph break before "In both cases." Making it part of the second paragraph of the definition obscures the fact that it applies to the first paragraph as well. |
@astearns OK, done! Thanks for the review~ |
@fantasai as you're working on these.
Do we add the 20px margin to whatever the 10px margin around the shape is calculated to be at that point, or do we use the maximum of the two values?
We've implemented using the maximum of the two margins, which seems to work better - you can set
shape-margin
to ensure the shape isn't adhered to too closely, andmargin-right
to push the content along. This also makes more sense withinitial-letters-wrap: first
, where both properties apply to the first line but onlymargin-right
on subsequent lines.The text was updated successfully, but these errors were encountered: