csswg-drafts
csswg-drafts copied to clipboard
[css-rhythm][css-values-4] Figure out the interaction between line-height-step and the lh and rlh units
The line-height-step property influences the line height.
The lh
and rlh
units depend on the line height.
We need to define if the property influences the units. I think it should.
The line-height-step property changes the algorithm to compute the line height. If lh
resolves to a used line height, it should. I haven't given enough thoughts if a unit can refer to a used line height but AFAIU you and tab were discussing it, right?
Currently, lh
is specified to refer to the computed line height. Can we move all this to computed time?
It seems to me that if we wanted to depend on the actual adjusted line height taking the content into account, we would need to do everything at used value time.
However, at computed value time, it should be possible to take the height of an empty line as adjusted by line-height-step. That sounds better to me than having units that resolved at used value time, which seems like a pretty big headache.
(sorry for closing and reopening. I just meant to comment and mis-clicked).
Also, we need to define what the lh
and rlh
units mean when used in the line-height-step
property. I think they should give the non-adjusted / natural line height.
Any use cases to prefer that?
@MurakamiShinyu
Agreed with frivoal on the points.
Koji, we can't use used-value inputs into units, because they compute to absolute lengths at computed value time...
Blink has the same constraints, can't use used-value to compute styles, that's ok.
I'm just curious, when we have a choice to round up during the style recalc, and @frivoal preferred not to do that IIUC, that what the reasons behind it.
-
lh
(andrlh
) should reflect the size of the line-height adjusted by line-height-step, otherwise they are not usable. I will be typical to want a padding or a margin to be sized a a multiple (often 1, but not always) of the line height. For this to work, it must be the adjusted line height. Of course, each individual line may end up being different sizes depending on what's in them, but the basic step size of the rhythm is what matters here. -
when we do that, we need to break the cycle that is introduced by trying to use
lh
as a value inline-height-step
(andrlh
inline-height-step
on the root element). I can think of two solutions:- use the (adjusted) line-height from the parent element
- use the non-adjusted line-height from the current element.
I don't have data to support me, and I think I at this point I could go either way, but (ii) seems more useful.
I see, you're talking about cycles.
Can we do something like what we do for em
?
This was discussed during a conf call, and generally agreed about. Someone now needs to write the proposed edits. (Could be me, @fantasai @tabatkins ...)
What was the agreement referred to above?
Ohh, talk about a backlog… sorry for the "small" delay. I believe the relevant minutes are these ones: https://lists.w3.org/Archives/Public/www-style/2017Apr/0027.html The summary is:
The proposed solution is lh includes calculation of line-height-step and if lh is used in line-height-step property, it refers to unadjusted line-height property.
The details are in the minutes.