Re: [csswg-drafts] [css-page] Spec seems confused about descriptors and properties (#5969)

There is also this part in [CSS Syntax 3 - 9.2. At-rules](https://drafts.csswg.org/css-syntax-3/#at-rules):

  > At-rules are used to: [...] declare style information that is not associated with a particular element, such as defining counter styles [...]
  >
  > Block at-rules will typically contain a collection of (generic or at-rule–specific) at-rules, qualified rules, and/or descriptor declarations subject to limitations defined by the at-rule.

If I'm not mistaken, `@nest` contains property declarations.

In my personal experience, the distinction made in the definition of a [declaration](https://drafts.csswg.org/css-syntax-3/#declaration) (quoted below) between property and descriptor declarations was not enough. Sometimes I still (incorrectly) associate at-rules to descriptor declarations and qualified rules to property declarations.

  > Declarations are further categorized as **property declarations** or **descriptor declarations**, with the former setting CSS properties and appearing most often in qualified rules and the latter setting CSS descriptors, which appear only in at-rules. (This categorization does not occur at the Syntax level; instead, it is a product of where the declaration appears, and is defined by the respective specifications defining the given rule.)

CSS Nesting does seem to clearly define that nested style rules (directly nested or `@nest`) contain property declarations. I have to assume that they are a subtype of style rules, and then I have to refer to the definition of [style rules](https://drafts.csswg.org/css-syntax-3/#style-rules) in CSS Syntax.

There is this other sentence in 9.2. At-rules (which comes much later than the definition of a declaration):

  > Descriptors are similar to properties (and are declared with the same syntax) but are associated with a particular type of at-rule rather than with elements and boxes in the tree.

If I set out to distinguish a property/descriptor based on whether it applies to an element or an at-rule, I'm in trouble. Furthermore, afaict, a declaration in a feature/supports or style query (`<supports-decl>` or `<style-feature>`) contained in the prelude of `@supports` or `@container`, can only be a property declaration.

Maybe a note below the definition of a declaration, with some examples can be helpful for people like me who are not able to figure out quickly and persistently remember how to tell them apart.

-- 
GitHub Notification of comment by cdoublev
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5969#issuecomment-1212801039 using your GitHub account


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

Received on Friday, 12 August 2022 07:12:37 UTC