Skip to content

[css-conditional-5] Missing edits for queryless @container #13674

@cdoublev

Description

@cdoublev

Omitting <container-query> in the prelude of @container is allowed since #9192.

But § 5. Container Queries seem to be missing related edits:

By default, all elements are query containers for the purpose of container style queries, and can be established as query containers for container size queries and container scroll-state queries by specifying the additional query types using the container-type property (or the container shorthand). Style rules applying to a query container’s flat tree descendants can be conditioned by querying against it, using the @container conditional group rule.

I do not know if elements can be established as query containers if they match a @container's condition whose <container-query> is omitted. Perhaps query containers should be reworded to condition containers?


Somewhat related. Browsers seem to match <container-name> against the computed value of container-name, as shown in this example.
<style>
  article {
    --name: name;
    container-name: var(--name);
  }
  @container name (--name: name) {
    div { color: green }
  }
</style>
<article>
  <div>green</div>
</article>

Evaluating the computed value is explicitly defined for size/style/scroll container query, but not for the query container name.

Could it be?

  The <container-name> filters the set of query containers considered 
- to just those with a matching query container name.
+ to just those with a matching computed value of their query container name.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions