-
Notifications
You must be signed in to change notification settings - Fork 779
Description
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-typeproperty (or thecontainershorthand). Style rules applying to a query container’s flat tree descendants can be conditioned by querying against it, using the@containerconditional 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.