- From: CSS Meeting Bot via GitHub <sysbot+gh@w3.org>
- Date: Wed, 13 Nov 2024 17:54:30 +0000
- To: public-css-archive@w3.org
The CSS Working Group just discussed `[css-values-5] attr() and forwards compatible parsing`, and agreed to the following: * `RESOLVED: Accept proposal to use type(<syntax>), add string, and add units as keywords.` <details><summary>The full IRC log of that discussion</summary> <fantasai> Scribenick: fantasai<br> <fantasai> TabAtkins: We switched attr() to use type definition syntax, similar to variables<br> <fantasai> TabAtkins: But working through that, we lost some abilities<br> <fantasai> TabAtkins: for example, saying the attr is a number representing px values<br> <fantasai> TabAtkins: It started to get too complicated for common cases<br> <fantasai> TabAtkins: For grammar ambiguity reasons, we suggest to wrap in type() function<br> <fantasai> TabAtkins: and end up with a lot for simple cases.<br> <fantasai> TabAtkins: Suggestion is to keep the <syntax> argument, but wrapped in type()<br> <fantasai> TabAtkins: but for two cases we have an easier way to specify<br> <fantasai> TabAtkins: for default behavior of treating attr value as a string, we introduce a keyword (string) so you can say so explicitly<br> <fantasai> TabAtkins: and secondly, add all units as keywords, which parse as a number and attach that unit<br> <fantasai> TabAtkins: this does slightly reduce the power of the syntax compared to before, since can't mix this behavior with other values<br> <fantasai> TabAtkins: but I think it's OK, not a high-value use case right now; can evaluate later or add to <syntax> production<br> <fantasai> TabAtkins: but instead of type(<number px>) can just write px, much simpler<br> <fantasai> TabAtkins: so proposal is<br> <fantasai> 1. Add type() wrapper around <syntax><br> <Rossen0> q?<br> <kizu> +1 to the proposal<br> <fantasai> 2. Introduce string keyword for explicitly indicating string parsing<br> <chrishtr> +1<br> <fantasai> 3. Add all units to attach to a <number><br> <lea> I don't understand the proposed options<br> <TabAtkins> attr(foo type(<length>))<br> <TabAtkins> attr(foo string) (deffault behavior)<br> <fantasai> attr(attributename [ type(<syntax>) | string | <unit> ], fallback)<br> <TabAtkins> attr(foo type(*))<br> <fantasai> lea: can you parse in a token stream?<br> <fantasai> TabAtkins: yes, use * just like in custom properties<br> <ydaniv> +1<br> <fantasai> lea: what's without the proposal?<br> <fantasai> attr(attributename <syntax>, fallback)<br> <fantasai> TabAtkins: wanted to wrap type() because <syntax> would make parsing complicated if we add anything in the future<br> <fantasai> lea: could we use keyword instead of type()?<br> <florian> wfm<br> <fantasai> TabAtkins: using type() because that's what we do in custom functions<br> <fantasai> TabAtkins: thought about using 'as' but consistency is good<br> <fantasai> lea: no way to use 'as' in functions? presumably want to know where the syntax terminates<br> <fantasai> TabAtkins: yes, and in some cases if you want to accept several keywords...<br> <fantasai> TabAtkins: having type() wrapper makes it clearer<br> <lea> +1<br> <TabAtkins> attr(foo type(one | two | three))<br> <oriol> +1<br> <fantasai> wfm<br> <fantasai> Rossen0: Anyone else? Any objections?<br> <fantasai> RESOLVED: Accept proposal to use type(<syntax>), add string, and add units as keywords.<br> </details> -- GitHub Notification of comment by css-meeting-bot Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/11035#issuecomment-2474348198 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 13 November 2024 17:54:31 UTC