8000 [css-cascade-6] Can we support implicit scopes in nested settings? · Issue #10497 · w3c/csswg-drafts · GitHub
[go: up one dir, main page]

Skip to content

[css-cascade-6] Can we support implicit scopes in nested settings? #10497

@mirisuzanne

Description

@mirisuzanne

We have previously resolved to supply an 'implicit' scope-root inside <style>. The root is the parent node of the <style> element:

<article id="my-thing">
  <style>@scope { /* similar to `@scope (article#my-thing)` */ }</style>
</article>

A different implicit scope-root might be more useful when @scope is nested inside other selectors. In that case, I would expect the missing (<scope-start>) should default to (&):

article {
  /* un-scoped `article` declarations */

  @scope { /* same as `@scope (&)` */ }
  @scope to (.another-thing) { /* @scope (&) to (.another-thing) */ }
}

That isn't exactly a parallel behavior, and I'm not sure if there are edge cases where it might be unclear which is intended. But I think this would be the most useful/expected result from a nested @scope syntax.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Thursday morning

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0