-
Notifications
You must be signed in to change notification settings - Fork 715
[css-cascade] What is a valid at-rule? Or what is an invalid at-rule? #9175
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
As far as I know, excluding rules in invalid order, there are rules invalid in the context (eg. Also curious if there are other cases. |
This works : @top-left {}
@import url("./green.css"); @media all;
@import url("./green.css"); @namespace ns {}
@import url("./green.css"); This does not : @property --foo {
inherits: false;
initial-value: 0;
}
@import url("./green.css"); I am only testing Chrome, not looking at interop at this time. |
Yeah, FF discards it. I guess it is a bug in Chrome. In 8. CSS stylesheets - CSS Syntax:
Note the link on invalid:
It could be a bit more exhaustive regarding invalid in the context. |
FF doesn't support |
Hmm, it supports |
However I think they should honor |
It's an at-rule that's valid, per the relevant spec defining that at-rule. I'm not sure how else that could be stated. Could you clarify what exactly you're finding unclear about this? |
That is obvious in hindsight :) @cdoublev Does raises an interesting point about https://drafts.css-houdini.org/css-properties-values-api/#at-property-rule
This doesn't work : @property --foo {
inherits: false;
initial-value: 0;
}
@import url("./green.css"); This does : @property (--foo) {
inherits: false;
initial-value: 0;
}
@import url("./green.css"); From the outside this looks as if only the prelude is checked for validity in this specific case. I think the specifications are clear but maybe there are a few blind spots in WPT and some bugs in implementations? |
Maybe something like in Selectors - 3.9. Invalid Selectors and Error Handling:
(I have no strong opinion on whether defining this explicitly is needed) Edit: I think I am wrong here (as well as CSS Fonts for
Whatever the content of the block, it must not be able to invalidate its rule. |
https://drafts.csswg.org/css-cascade-5/#at-import
After reading this I was curious what the exact definition is for a valid at-rule.
I assume that the intention is to allow new at-rules to be added to the language later without invalidating all imports in older browser versions.
It wasn't immediately clear to me exactly when an at-rule becomes invalid.
Is it only when the at-keyword-token is unknown? (e.g.
@unknown {}
)Things I noticed I could place before an
@import
and still have it apply :The text was updated successfully, but these errors were encountered: