-
Notifications
You must be signed in to change notification settings - Fork 673
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-values-4] Clarify that function component values need to be followed by parentheses #5728
Comments
So for example in https://drafts.csswg.org/css-grid/#repeat-syntax, you would rename What if you have a disjunction of different function values, like in |
Yes, or do it the other way round and don't allow parentheses within those names. The point here is to have a clear definition for how they should look like to get consistency. Sebastian |
I think Images 4 is the one that's wrong here, we've traditionally not used parentheses in value types (see, e.g., |
Parens in non-terminals are just a way to implicitly refer to the grammar of the given function, like Things like |
@tabatkins That is totally not true. |
So fantasai and I discussed this a bit, and I realized I'd forgotten that this Like I said in my previous comment, the point of it is to serve the same purpose as It also serves as an automatic namespacing mechanism - rather than defensively naming function grammars as So, all the examples Oriol provides are invalid - none of those are the definition of the named functional notation. The non-terminals used there are indeed standard non-terminals, and should continue to be written as such. We should, however, add this syntax to the Value Definition Grammar if we're going to keep using it. (Also for at-rules as <<@rule>>, which Bikeshed also allows.) And I should update the bits of my specs where I wrote grammars like Agenda+ to ask if we want to add this convention, or just keep to only ident-based non-terminals. Examples:
|
Tab's explanation and suggestion sound totally logical to me. So 👍🏻 for that from my side. Sebastian |
The CSS Working Group just discussed
The full IRC log of that discussion<fantasai> Topic: [css-values-4] Clarify that function component values need to be followed by parentheses<fantasai> github: https://github.com//issues/5728 <emilio> fantasai: So tab added bikeshed functionality in which he can link to a function definition using `<ident()>` <emilio> fantasai: but this is not actually valid according to our value definition grammar <fantasai> <'property-name'> <fantasai> <keyword> <emilio> ... that has quoted property references and terminal kws (^) <emilio> ... so should we add this to the value-definition grammar and update all specs to use this convention? <emilio> ... a subtle thing is that only terminals that represent a function will use this <emilio> ... historically we haven't done this, e.g., `<url>` <emilio> ... so the question is do we want to extend our syntax in this way <fantasai> chris_: I would find this useful, have needed <foo> vs <foo()> <fantasai> astearns: So proposal is to add <name()> to our grammar <fantasai> s/grammar/grammar for specs/ <fantasai> astearns: Will that require going back and fixing everything? <fantasai> fantasai: I think it would be useful to make things consistent <fantasai> fantasai: but I wouldn't do it for <url> <fantasai> astearns: If not required, it's better; would prefer not to mess with old things <fantasai> astearns: Any other opinions? <fantasai> RESOLVED: Add this to the Value Definition Grammar |
Note that switching all our |
Added definitions of |
In https://drafts.csswg.org/css-values-4/#component-types the different component value types are defined.
And Function definitions are mostly specified separetely from where they are used, so they are referenced by non-terminal values like
<image()>
in https://drafts.csswg.org/css-images-4/#image-values.So far, there is no note in the specification how the names of those values should look like. This causes some confusion like in w3c/fxtf-drafts#410.
In order to clarify that and make it consistent across specifications, I suggest to formalize that the names of those values need to be followed by an opening and a closing parenthesis.
Sebastian
The text was updated successfully, but these errors were encountered: