-
Notifications
You must be signed in to change notification settings - Fork 709
[css-values] Cyclic definitions with relative units #2115
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 think there's a simpler solution, and it is the one I intended when I proposed the text, but it looks like that got lost along the way, or the the initial wording may have been ambiguous as well (this commit seems to be the culprit to me: 95f91ae). I think This rules out setting the line-height to something manually to some absolute value, and then setting the font-size on the same element to a function of that, which your approach would enable, but I don't think there's a use case for that, and always going for the parent is much simpler. So, it seems that a sufficient fix would be to change/clarify:
into
|
@frivoal Seems reasonable, but I think this does not solve the problem when using CSS Variables that compute to a |
Definition of max recurency cycles if var is used? If next request to calculate then write 0 instead of calculating n times? |
@Loirooriol I think the problem of cycles in CSS Variables that compute to a So I think we should limit the discussion in this issue to resolving the |
The Working Group just discussed
The full IRC log of that discussion<dael> Topic: [css-values] Cyclic definitions with relative units<dael> github: https://github.com//issues/2115 <fantasai> fantasai^: Styling the table as all 'display inline' would have no effect on whether these pseudo-classes matched <dael> florian: There's already a bit of prose that says if you try to use the em usit in font size property or any usit that depends on font size in the font size property we say you fetch from the parent to avoid a loop. <dael> florian: There was a poorly owrded way to attach this to lh when defining line height. TH emis-phased part meant we still have a problem if trying to do line height in terms of font size. <dael> florian: What I tried to do is say all font dependant units go to the parent and in addition lh also goes tot he parent if you use it in line height. That breaks the loops. <dael> florian: We could have a less blunt approach, but I don't think there's use cases for the more subtile variants. <dael> florian: Precise wording is in the issue. <dael> fantasai: Works for me. <dael> myles: I agree we shouldn't be in the business of trying to do a complex dependency analysis. <dael> Rossen_: I'm waiting for others to have a moment to consider. <dael> dbaron: The proposal is that lh goes to the parent if used in font size or line height. <dael> florian: Yes. <dael> dbaron: Okay. <dael> ericwilligers: Other things like height? <dael> florian: No, there's no loop. <dael> ericwilligers: I know there's no loop, but seems confusing if lh appears 5 times and means 5 different things. <dael> ??: we have that with ems <dael> ericwilligers: Don't want to make it worse. <dael> florian: We need to keep toehr cases working because that's the point of hte lh unit. Only sensible option would be to ban it from line ehight. <dael> Rossen_: But for the same reason we should have banned em from font. <dael> florian: And we didn't <dael> Rossen_: And I think anyone that used em in fonts understands how they did it. <dael> Rossen_: So, obj to define lh unit resolution to be that of the aprent when the lh unit is spec on line height or font size? <myles> +1 <dbaron> The cases that go to the parent here are probably cases that can be safely recommended against. <dael> RESOLVED: define lh unit resolution to be that of the parent when the lh unit is spec on line height or font size <dael> dbaron: Should the spec have a not saying we suggest not using that behavior? Suggest it's poor practice to use it that way <dael> myles: Is there one for em? <dael> dbaron: I don't htink so. <dael> florian: If we had a plh unit I would say it is, but since we don't I'm not sure it's bad practice. <dael> Rossen_: I'm fine with either note or no note. If dbaron you feel it's really nec? <dael> dbaron: I don't. It's just a thought. |
PR for tests over here: web-platform-tests/wpt#8886 |
Reopening, because I think this needs further edits. |
@fantasai What did I miss? |
ping @fantasai. Could you say what you think is missing here? |
ping @fantasai |
CSS Values 4 introduces the
lh
unit. How exactly does the following resolve?Or using
registerProperty
from CSS Properties and Values,You can use the codes above to make the computed value of
font-size
depend on the computed value of another property that depends on the computed value offont-size
.I think you should generalize this:
into this:
Then,
Another approach could be resolving
font-size
andline-height
first, by making relevant font-relative units andvar()
functions retrieve the value from the parent.But I don't think CSS Values should mess with CSS Variables by altering what
var()
does.The text was updated successfully, but these errors were encountered: