-
Notifications
You must be signed in to change notification settings - Fork 713
[css-inline-3] The interaction of text-box-edge
with line-height
is not predictable by authors
#8476
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
I'm not entirely sure I understand your complaint here, but I suspect you're confused about something.
No, see the statement higher up that says
|
Okay, thanks for clarifying. This makes more sense now. The case we're thinking of is something like this: (Imagine A+D = 14px, but the author doesn't know this, because authors don't know the exact metrics of the fonts they use)
|
I'm open to other solutions, but the problem is that if you ask for tighter setting, you need to get it, and if every span contributes its A+D (for some value of A+D based on the metrics chosen in The fundamental model we are going for is:
If they ask for tighter spacing ( |
General note:
Side note on this: Debugging such issues already causes authors headaches today. Developer tools around inline layout still need to be created. With the introduction of Sebastian |
text-edge
with line-height
is not predictable by authorstext-box-edge
with line-height
is not predictable by authors
[This is one of a series of issues we're filing about the design feedback of
leading-trim
andtext-box-edge
. As far as we know, these properties are unimplemented in any browser, which means now is a good time to give feedback on their overall design. For each of the issues we're filing, we don't have a fully-formed proposal that would solve the problem, but we do have some avenues of potential mitigation in mind, and we're offering these ideas as a starting point for further discussion.]There’s a threshold, where if the
line-height
is above that threshold, it is ignored, but if it’s below that threshold, it’s applied.The spec says:
We’re assuming this indicates that, if the half-leading is negative,
text-box-edge
is disregarded.However, negative half-leading is pretty common: authors don’t go so far as to make their lines collide, but most fonts are constructed such that the ink doesn’t actually reach all the way up to the top of the ascent for most text. In places where space on the page is tight, it’s fairly common for a CSS author to tighten up the line height more than the line gap metric so the lines are more snug.
An author writing a web page doesn’t know exactly where the ascent and descent metrics of their font lie. They don’t know whether or not their half-leading is positive or not. They just tweak
line-height
until the lines look good. It will be frustrating to an author to adjust their content’s line height, but their adjustments stop working at some magical value, because some other property (text-box-edge
) was specified somewhere else. (Recall thattext-box-edge
is inherited.)One potential solution is to make one of the two always win when both are applied to the same element.
Another potential solution is described in #8478.
The text was updated successfully, but these errors were encountered: