[csswg-drafts] consider dividing future selector syntax and future declaration syntax differently (#8251)

dbaron has just created a new issue for https://github.com/w3c/csswg-drafts:

== consider dividing future selector syntax and future declaration syntax differently ==
One of the things that came up in today's discussion of issue #8248 of the "option 3" syntax proposal is Peter's point that it reserves nearly all of the future expansion space for selector syntax and very little of it for declaration syntax (where declarations are currently basically property:value pairs, possibly with `!important` at the end).  I wanted to open this issue to explore dividing the future expansion space differently.

The underlying problem is that Option 3's nesting syntax introduces places in CSS syntax that accept *either* declaration syntax or accept selector syntax (excluding selectors that begin with an identifier or a function).  These syntaxes (thanks to the exclusion) currently do not overlap.  However, barring adding further exclusions in the future, this means that future expansions of either selectors or the declaration syntax would need to fit within the rules we define for how we determine what is a selector versus what is a declaration.  This means that we are constraining one or both of future selector syntax expansion or future declaration syntax expansion.  Peter noted (as part but not all of his concern) that we were reserving the bulk of the space for selectors and very little for declarations.

A few initial notes:
* Some places where we've considered expanding the declaration syntax are for additive cascade and maybe for expression of constraints on property values.
* Following [my earlier comment](https://github.com/w3c/csswg-drafts/issues/7834#issuecomment-1283019419) we did agree to reserve functions for the property:value space rather than the selector space, for the reasons discussed in that comment.
* I think the future expansion space for selector *combinators* is very small.  I think plausible future combinators are `!`, `$`, `%`, `/`, `<`, `=`, `?`, `^`, and `` ` ``.  There has been some discussion of the possibility that future combinator expansion might use `/keyword/` syntax and thus end up using only one of those symbols.  (Most of the others may be somewhat undesirable as combinators for various other reasons as well, although `<` is certainly plausible from a syntax perspective.)

The things that the Option 3 proposal currently reserves for declaration syntax are things beginning with:
* identifiers
* functions (which, as noted above, should not be distinguished from identifiers unless absolutely necessary)

The things that the Option 3 proposal currently reserves for selector syntax *and* needs to do so in order to support selectors that are valid today (including the `&` added by the nesting proposal) are things beginning with:
* The symbols `:`, `&`, `>`, `+`, `~`, `|`, `.`, and `#`
* Blocks beginning with `[`

The things that the Option 3 proposal currently reserves for selector syntax but which are not required by selectors as they exist today and which could be used by future CSS syntax are things beginning with:
* numbers and dimensions
* The symbol `/` (see above about combinator expansion; probably desirable for combinators)
* The symbol `<` (which is probably desirable to keep with `>`, which is in the previous list)
* The symbols  `!`, `$`, `%`, `=`, `?`, `^`, and `` ` `` (see above about combinator expansion, may be less desirable for combinators)
* The symbol `,`
* Blocks beginning with `(`
* Strings beginning with `'` or `"`

I'm opening this issue to consider whether we should refine option 3 by moving some of the things in the final list into the space of things that are reserved for future declaration syntax rather than the space of things that are reserved for future selector syntax.

(Note that I've probably made some mistakes in the above lists of characters, and I expect to need to edit this comment later and document those edits below.)

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8251 using your GitHub account


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

Received on Wednesday, 21 December 2022 19:38:29 UTC