Skip to content
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

[css-rhythm][css-values-4] Figure out the interaction between line-height-step and the lh and rlh units #937

Open
frivoal opened this issue Jan 16, 2017 · 12 comments

Comments

@frivoal
Copy link
Collaborator

frivoal commented Jan 16, 2017

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.

@kojiishi
Copy link
Contributor

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?

@frivoal
Copy link
Collaborator Author

frivoal commented Apr 7, 2017

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.

@frivoal frivoal closed this as completed Apr 7, 2017
@frivoal frivoal self-assigned this Apr 7, 2017
@frivoal frivoal added the Agenda+ label Apr 7, 2017
@frivoal frivoal reopened this Apr 7, 2017
@frivoal
Copy link
Collaborator Author

frivoal commented Apr 7, 2017

(sorry for closing and reopening. I just meant to comment and mis-clicked).

@frivoal
Copy link
Collaborator Author

frivoal commented Apr 7, 2017

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.

@kojiishi
Copy link
Contributor

kojiishi commented Apr 7, 2017

Any use cases to prefer that?

@MurakamiShinyu

@fantasai
Copy link
Collaborator

fantasai commented Apr 7, 2017

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...

@kojiishi
Copy link
Contributor

kojiishi commented Apr 9, 2017

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.

@frivoal
Copy link
Collaborator Author

frivoal commented Apr 10, 2017

  • lh (and rlh) 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 in line-height-step (and rlh in line-height-step on the root element). I can think of two solutions:

    1. use the (adjusted) line-height from the parent element
    2. 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.

@kojiishi
Copy link
Contributor

I see, you're talking about cycles.

Can we do something like what we do for em?

@frivoal
Copy link
Collaborator Author

frivoal commented Apr 18, 2017

This was discussed during a conf call, and generally agreed about. Someone now needs to write the proposed edits. (Could be me, @fantasai @tabatkins ...)

@lilles
Copy link
Member

lilles commented Oct 12, 2022

What was the agreement referred to above?

@frivoal
Copy link
Collaborator Author

frivoal commented Oct 19, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants