-
Notifications
You must be signed in to change notification settings - Fork 143
[css-properties-values-api] var() references to <length> type properties with font-relative lengths #315
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
Oh dang, this is a difficult question. I didn't anticipate this adding a new cyclic dependency. (Good thing We'll need to make an arbitrary decision here. I think my preferred solution is to lean on normal variable dependency-cycle resolution - custom properties containing a font-relative length (this requires them to be typed, with a |
Is it valid to conceptualize this as there being a phony variable Should the following declarations with It seems like because the
EDIT: Oops, can't have the unmatched ). But we can end up with the same effect I was intending ( |
Also, what about |
Actually, it seems like maybe something even stronger (like the following) would be needed:
This is because even if the EDIT: I have a patch to implement this for Servo. |
The Working Group just discussed
The full IRC log of that discussion<nainar> Topic: var() references to type properties with font-relative lengths<nainar> GitHub: https://github.com//issues/315 <nainar> TabAtkins: Issue has the case <look at it> <nainar> TabAtkins: <Explains issue as written in github issue> <nainar> TabAtkins: Preferr to lena on dependancy resolution. They should gain a dependacy on the font zie property and a cyclic dependacy would make the property invalid at computed time. <nainar> dbaron: This isnt ehe only case of unit type dependacy on property. <nainar> TabAtkins: Generalize to other properties too. <nainar> dbaron: Is this only for typed custom props? <nainar> TabAtkins: Yes. <nainar> Discussion about naming typed/registered custom propries <nainar> TabAtkins: Are we doing to get in this case 100px and 1000 px for font size and variable <nainar> TabAtkins: Or will we get somethign invalid with font size returning to 1 em? <nainar> dbaron: var reference is referencing a computed value it should be invalid. <nainar> TabAtkins: Make sure I capture all teh cases that dcan cause this and add to graph. I am down with this. <nainar> Rossen: <agrees> <nainar> astearns: Property is invalid right? <nainar> TabAtkins: If invalidation happens font would be invalid and retun to inherit. <nainar> astearns: Typed property would be fine? <nainar> TabAtkins: Yes <nainar> dbaron: What about units that depend on font selection? <nainar> dbaron: What if you use a calc expression in one of those units? <nainar> TabAtkins: you can do this for font weight for e.g <nainar> TabAtkins: they are depdant on font peropeties and if you depend on that you have a cyclic dependacy <nainar> dbaron: Hard - that there is a dependacy graph in everyone's head - need to write this down <dbaron> https://wiki.csswg.org/spec/property-dependencies <nainar> fremy: Can you define font size as a custom property and get in the same situation?> <nainar> TabAtkins: NO in that case you get a percent if y9ou ask for a computedvalue <nainar> fremy: so a % can stay as a % on computedtime <nainar> <discussion about link> <nainar> TabAtkins: These tables need to be translated to spec txt for completion <nainar> xidorn: color and currentColor comment in issue doesnt apply. currentColor should be computed at computedvalue tinme not used value time. <nainar> TabAtkins: Yes it does. <nainar> tantek: People want to specify full set of unit and depdancyies and using that in exisitng variable dependancy logic <tantek> s/tantek/??? <nainar> Rossen: Solution to this issue would fall out of it? <nainar> TabAtkins: ues <TabAtkins> s/ues/yes/ <tantek> s/???/TabAtkins <nainar> RESOLVED: specify full set of unit and depdancyies and using that in exisitng variable dependancy logic. This issue is solved from there. |
We need to:
I think in terms of unit–property dependencies, that should cover it, no? |
@tabatkins Close? |
Consider a property --font-size, registered to be of
<length>
type. What should the computed values of font-size and --font-size be?--font-size: 10em;
font-size: var(--font-size);
If --font-size is substituted as "10em", then font-size is
10*parent
and --font-size is100*parent
. If it is substituted after computation then what value do we use for the em unit?The text was updated successfully, but these errors were encountered: