-
Notifications
You must be signed in to change notification settings - Fork 711
[css-page] Spec seems confused about descriptors and properties #5969
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
Comments
Those are all descriptors, even if they match the name and syntax of existing box properties. Since Page is one of our oldest specs, it's very much not surprising that it's not disciplined about its terminology. |
Ooof, yes, most but not all uses of Also, the "previous versions" is missing the 2018 publication |
There is also this part in CSS Syntax 3 - 9.2. At-rules:
If I'm not mistaken, In my personal experience, the distinction made in the definition of a 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.
CSS Nesting does not seem to clearly define that nested style rules (directly nested or There is this other sentence in 9.2. At-rules (which comes much later than the definition of a declaration):
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 ( 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. EDIT: in my personal notes, I summarized with a declaration for a descriptor can only exist in an at-rule's block value. A declaration for a property can exist in any rule, in its block value or its prelude (as a feature aka. supports query or as a style query). |
We're obviously diving deep into the Syntax spec. here and are side-tracking with
Yes. I guess
Though that's something that should be discussed in a separate issue.
The association should be the other way round. Descriptor declarations are always part of an at-rule. Though property declarations are normally part of a qualified rule but can also be part of an at-rule.
In my opinion, it has a clear definition in its syntax and in textual form. It says this:
And the syntax definition looks like this:
So it clearly states that everything in it is a style block, which represents the contents of a style rule's block.
What exactly is your issue here? Coming back to
So the declarations only apply to a page and not to elements, so they are descriptors.
I'd say so, but again, style declarations are not prohibited within at-rules.
👍🏻 from me for that. For reference I want to note #632 and the related commit, in which the syntax of Sebastian |
Would you consider the declarations of a keyframe rule to apply on an element or to the parent Thanks for the reply. My aim was to show that it is not easy to grasp the nuances between a descriptor and a property. After posting my previous comment, I became aware of the issue about the current coupling between properties, As for |
Also, if you allow me to ask the following question here, can you please confirm that CSS-wide keywords and custom variables can only apply to descriptors corresponding to properties? Ie. in |
As @tabatkins wrote earlier, the declarations inside
Having said that, the spec. defines cascading within the page context. Regarding CSS-wide keywords, at least Also please note that I am also just interpreting the specifications. @fantasai, @SimonSapin or @tabatkins are the authors of the two relevant specs. Maybe they can confirm whether the statements above are correct. Though I think the specs could benefit from some clarification here. Sebastian |
CSS page states:
I would absolutely expect this to apply to to custom properties as well as regular properties, and having tested the implementations at https://printcss.live all but one of the implementations that support custom properties also support them in the I didn't test for For |
@page
potentially supports a variety of CSS properties, and some descriptors likesize
,page-orientation
, etc.It however seems to use the term 'property' for descriptors in arbitrary places... Should probably be less confused?
cc @fantasai
The text was updated successfully, but these errors were encountered: