-
Notifications
You must be signed in to change notification settings - Fork 75
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
Comments
In practice, CSS specs do call that a descriptor too: 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 |
Ah, I see. @tabatkins Is this something that can be improved in the CSS specifications? |
Yeah, that's just us misusing the syntax a bit. We don't (currently?) have any overlap between "at-rules that take descriptors" and "at-rules that take declaration-like syntax in their prelude", so doing it this way was convenient. @romainmenke What's the context for needing the distinction? |
We'd like to use this data in various dev tools (linters, syntax highlighting, auto complete, ...). Currently most tools use To be able to use this data we need to know if the descriptors listed are relevant in the block part, or in the prelude. We can use hard coded lists of at rules that fall in either group. We already have plenty of escape hatches for editorial overrides because not everything can be expressed in the syntax definitions. But we try to minimize this as much as possible. |
Yes, a hard-coded list would be the way to go, imo. While nothing a priori prevents there from being overlap, I doubt there will be; all the ones with stuff in the prelude are conditional rules that contain style rules in their body; everything else (that has descriptors instead) has a trivial prelude or none at all. |
@romainmenke if indeed you develop a hardcoded list, it would be interesting to see if we could have it incorporated and maintained in webref so that other consumers may benefit from it. |
Was thinking the same I don't know the webref internals, so I am unsure how this could be integrated here. |
For example in
css-conditional-5.json
:https://drafts.csswg.org/css-conditional-5/#descdef-container-width
This describes a container feature to be used in the atrule prelude:
It does not describe a descriptor.
The text was updated successfully, but these errors were encountered: