Skip to content
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 at rules have unexpected descriptors #1375

Open
romainmenke opened this issue Nov 1, 2024 · 2 comments
Open

CSS at rules have unexpected descriptors #1375

romainmenke opened this issue Nov 1, 2024 · 2 comments

Comments

@romainmenke
Copy link
Member

For example in css-conditional-5.json:

    {
      "name": "@container",
      "prose": "The @container rule is a conditional group rule whose condition contains a container query, which is a boolean combination of container size queries and/or container style queries. Style declarations within the <block-contents> block of an @container rule are filtered by its condition to only match when the container query is true for their element’s query container.",
      "href": "https://drafts.csswg.org/css-conditional-5/#at-ruledef-container",
      "descriptors": [
        {
          "name": "width",
          "href": "https://drafts.csswg.org/css-conditional-5/#descdef-container-width",
          "for": "@container",
          "value": "<length>",
          "type": "range"
        },

https://drafts.csswg.org/css-conditional-5/#descdef-container-width

This describes a container feature to be used in the atrule prelude:

@container (width: 20px) {}

It does not describe a descriptor.

@tidoust
Copy link
Member

tidoust commented Nov 4, 2024

In practice, CSS specs do call that a descriptor too: width is defined with a data-dfn-type="descriptor" attribute in css-conditional-5, and the features are listed in an appendix named @container Descriptors.

The problem is that the term "descriptor" is overloaded in CSS. I do not see how the spec crawler could easily and automatically distinguish between something that can be used within the prelude and something that can be used within the final {}-block of an at-rule. It may be possible to make the crawler smart enough to parse the definition of the at-rule and understand where everything fits. Ideally, if the distinction is important, that distinction would also be explicit in the specs.

See also #479 which, I believe, raised the same problem for the @media at-rule.

@romainmenke
Copy link
Member Author

Ah, I see.
Yes, seems like the same issue as #479


@tabatkins Is this something that can be improved in the CSS specifications?
So that spec crawlers can distinguish between what is part of the prelude and what can be used in blocks?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants