Re: [csswg-drafts] [css-values-4] inherit() function: like var() for parent value, for any property (#2864)

The CSS Working Group just discussed `[css-values-4] inherit() function: like var() for parent value, for any property`, and agreed to the following:

* `RESOLVED: WG considered parent() and decided to stay with inherit()`
* `RESOLVED: define inhert() on custom properties only, as a step towards full thing`

<details><summary>The full IRC log of that discussion</summary>
&lt;TabAtkins> scribe+<br>
&lt;fantasai> lea: as pointed out, we already drsolved to do it<br>
&lt;fantasai> lea: but might be a good strategy to split out into parts<br>
&lt;TabAtkins> lea: There was a lot of use-cases for cusotm property inheritance, it has defined serialization and a lot of uses<br>
&lt;fantasai> lea: and precedent in container queries of starting with cascading properties, even though plan is to expand later<br>
&lt;fantasai> Laptop: another possibility could be to have custom properties plus a regstricted set of regular properties in L1<br>
&lt;astearns> s/Laptop/lea/<br>
&lt;TabAtkins> lea: The advantag ei sit covers mor euse-cases, the disadvantage is it's harder for authors to udnerstand which is which<br>
&lt;TabAtkins> lea: but tha'ts a problem with any allowlist, and there's several in cSS<br>
&lt;TabAtkins> lea: So I lean toward the "allowlist of properties"<br>
&lt;TabAtkins> lea: It would also be nice to resolve on a name, the issue still doesn't reflect consensus<br>
&lt;TabAtkins> lea: Seems consensus leans toward parent<br>
&lt;bramus> q+<br>
&lt;TabAtkins> lea: If that's the case, would be good to record a resolution<br>
&lt;fantasai> bramus: wanted to ask about naming towards parent()<br>
&lt;fantasai> bramus: that might imply from some non-native speakers to select the direct parent?<br>
&lt;fantasai> dbaron: that's exactly what it means<br>
&lt;lea> s/So I lean toward the "allowlist of properties"/So I lean toward custom properties + restricted allowlist of regular properties/<br>
&lt;fantasai> bramus: won't walk up to ancestors?<br>
&lt;fantasai> TabAtkins: it will inherit, so get the value from the parent<br>
&lt;fremy_> q+<br>
&lt;astearns> ack bramus<br>
&lt;TabAtkins> (I still like inherit(), but I'm happy with parent() )<br>
&lt;astearns> ack fremy_<br>
&lt;fantasai> fremy_: I think parent() is fine<br>
&lt;lea> fyi list of proposed names here: https://github.com/w3c/csswg-drafts/issues/2864#issuecomment-1645708854<br>
&lt;fantasai> fremy_: only thing I wonder if instead we can do var() with parent as first keyword<br>
&lt;fantasai> fremy_: then easy to add new sources later<br>
&lt;fantasai> fremy_: it's a bit longer though<br>
&lt;TabAtkins> var(parent --foo)<br>
&lt;fantasai> fremy_: just want to propose that but don't have a strong opinion<br>
&lt;lea> q?<br>
&lt;lea> q+<br>
&lt;fantasai> fremy_: but parent() doesn't express that it's a variable<br>
&lt;Rossen_> ack lea<br>
&lt;fantasai> lea: relating it to var() makes it sound like it's only for custom properties<br>
&lt;astearns> +1 lea<br>
&lt;fantasai> lea: but the goal is to extend to all properties<br>
&lt;fantasai> lea: highly unlikely that var() wil extend to all properties<br>
&lt;TabAtkins> right, impossible<br>
&lt;fantasai> fremy_: fine by me, if no objection to parent()<br>
&lt;oriol> q+<br>
&lt;fantasai> astearns: other opinions?<br>
&lt;astearns> ack oriol<br>
&lt;fantasai> oriol: about naming issue, I do like inherit() as a function<br>
&lt;fantasai> oriol: we already have the 'inherit' keyword<br>
&lt;fantasai> oriol: so this is an obvious extension to it<br>
&lt;fantasai> oriol: why add a completely different keyword<br>
&lt;fantasai> oriol: inherit also looks at the parent<br>
&lt;fantasai> +1 to oriol's argument<br>
&lt;Rossen_> +1 to inherit<br>
&lt;lea> inherit was a poor name, but I can see the argument for consistency.<br>
&lt;fantasai> astearns: any other opinions about inherit() , parent() etc?<br>
&lt;fantasai> dbaron: I think I might have a slight preference for parent() because inherit() is about taking the value from the same property and copying from parent to child<br>
&lt;fantasai> dbaron: but this is more general, says take the value of that property to use in this parent<br>
&lt;lea> q?<br>
&lt;fantasai> astearns: so argument for consistency is less because slightly different interpretation?<br>
&lt;fantasai> dbaron: that said not a strong preference<br>
&lt;fantasai> lea: the way I see inherit is, by default the default argument is the property itself, therefore can omit parens<br>
&lt;fremy_> if there is no strong preference, maybe we can strawpoll and just take the most popular one?<br>
&lt;fantasai> lea: whereas if you use a different property, you need to add parens and put as argument<br>
&lt;fantasai> POLL: 1. inherit() 2. parent()<br>
&lt;bramus> 2<br>
&lt;oriol> 1<br>
&lt;fantasai> 1<br>
&lt;Rossen_> 1<br>
&lt;dbaron> 2<br>
&lt;fremy_> 1<br>
&lt;SebastianZ> 1<br>
&lt;astearns> 1<br>
&lt;ydaniv> 1<br>
&lt;bts> 1<br>
&lt;TabAtkins> 1 or 2<br>
&lt;lea> abstain<br>
&lt;changseok> 1<br>
&lt;florian> 0<br>
&lt;miriam> either<br>
&lt;dholbert> abstain<br>
&lt;fantasai> astearns: not seeing a reason to change<br>
&lt;fantasai> PROPOSED: WG considered parent() and decided to stay with inherit()<br>
&lt;fantasai> RESOLVED: WG considered parent() and decided to stay with inherit()<br>
&lt;fantasai> astearns: you were arguing for doing just custom properties, or just custom properties and small subset, or doing all at once<br>
&lt;fantasai> dbaron: to be clear, talking about source property, not the property you're using the function in<br>
&lt;fantasai> [correct]<br>
&lt;fantasai> lea: want to hear from implementers<br>
&lt;fantasai> astearns: option to do custom properties now and rest later makes some sense to me<br>
&lt;fantasai> astearns: I'm less convinced about small subset<br>
&lt;fantasai> +1 to astearns<br>
&lt;emilio> +1<br>
&lt;fantasai> astearns: why should we do that?<br>
&lt;fantasai> lea: primary issue with arbitrary properties is primarly shorthands, and a lot of use cases (if not most) that don't require them<br>
&lt;emilio> q+<br>
&lt;fantasai> lea: so I suspect we can cover a fairly large percentage of use cases by having a well-selected allow-list<br>
&lt;fantasai> lea: while not needing to solve serialization<br>
&lt;fantasai> lea: but I'm not an implementer, great to hear from someone who is<br>
&lt;astearns> ack emilio<br>
&lt;fantasai> emilio: not particularly about shorthands, but let's consider a single example<br>
&lt;fantasai> emilio: you have font-family, and browser disagree whether to serialization as ident or string<br>
&lt;fantasai> emilio: and how you do that changes where it's valid to use<br>
&lt;fantasai> emilio: I think some properties first is a lot more controversial<br>
&lt;fantasai> emilio: for variables, you just have the tokens the author wrote, so no disagreements between browsers<br>
&lt;fantasai> fantasai: that's a large QA project<br>
&lt;fantasai> fantasai: [explains]<br>
&lt;fantasai> dbaron: we could get a bunch of the work done to detect differences by writing a fuzzer<br>
&lt;fantasai> dbaron: then we could look at how much work it is<br>
&lt;fantasai> fremy_: we tried when we did TypedOM, and ended up not finishing because so big<br>
&lt;fantasai> TabAtkins: big, but also I had other things to work on<br>
&lt;dbaron> s/a fuzzer/a fuzzer, with WPT as input/<br>
&lt;fantasai> TabAtkins: wasn't like it was unsolveable<br>
&lt;fantasai> iank_: it's solveable, but non-trivial amount of work<br>
&lt;fantasai> astearns: just so I'm clear on the inherit question<br>
&lt;fantasai> astearns: if we don't allow non-custom properties at the outset, ppl can work around it by setting a value on a var, and using inherit on that var<br>
&lt;fantasai> TabAtkins: yes<br>
&lt;fantasai> astearns: proposed to resolve on custom properties only at the outset<br>
&lt;TabAtkins> (finding a good allowlist is nearly the same work as finding all the differences and working toward fixing them)<br>
&lt;fantasai> RESOLVED: define inhert() on custom properties only, as a step towards full thing<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2864#issuecomment-1645794662 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 21 July 2023 15:53:08 UTC