Skip to content

[css-cascade-6] What rules are invalid in @scope? #8522

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

Closed
cdoublev opened this issue Mar 3, 2023 · 1 comment
Closed

[css-cascade-6] What rules are invalid in @scope? #8522

cdoublev opened this issue Mar 3, 2023 · 1 comment

Comments

@cdoublev
Copy link
Collaborator

cdoublev commented Mar 3, 2023

It is not clear whether @scope allows other CSS rules.

The syntax of the @scope rule is @scope [(<scope-start>)]? [to (<scope-end>)]? { <stylesheet> } where [...] <stylesheet> represents the scoped style rules.

https://drafts.csswg.org/css-cascade-6/#scope-syntax

All @scope examples in CSS Cascade 6 include (scoped) style rules.

Finally, the <stylesheet> production represents a list of rules. It is identical to <rule-list>, except that blocks using it default to accepting all rules that aren’t otherwise limited to a particular context.

For rules that use <stylesheet>, all rules are allowed by default, but the spec for the rule may define what types of rules are invalid inside the rule.

https://drafts.csswg.org/css-syntax-3/#rule-defs

@cdoublev
Copy link
Collaborator Author

cdoublev commented Mar 5, 2023

Sorry, I missed this part:

Global name-defining at-rules such as @keyframes or @font-face or @layer that are defined inside @scope are valid but are not scoped or otherwise affected by the enclosing @scope rule. However, any style rules contained by such rules (e.g. within @layer) are scoped.

I guess the meaning of <stylesheet> represents the scoped style rules is that @scope only creates scope for style rules.

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

No branches or pull requests

2 participants