ContainerQueryList Class
- Experimental (WEBPLATEXP0005)
A list of container conditions evaluated for an element, whose state can be observed, created by Element.MatchContainer. The API is proposed in https://github.com/w3c/csswg-drafts/pull/13551 and is modeled on MediaQueryList.
[Experimental("WEBPLATEXP0005", UrlFormat = "https://github.com/meziantou/Meziantou.Framework/blob/main/src/Meziantou.Framework.WebPlatform/docs/experimental-apis.md#{0}")]
public sealed class ContainerQueryList : EventTargetRemarks
The conditions are evaluated like the conditions of a @container rule that applies to the element (see ContainerQueries): the list matches when the element is connected and one of its conditions is true. The change events are fired when the event loop updates the rendering, after the change events of the media query lists, while the document of the element is fully active.
See also
- Inheritance
EventTargetContainerQueryList
Properties
| Name | Description |
|---|---|
| Matches | Gets whether one of the container conditions is true for the element; false when the element is not connected. The ancestors that generate no box (in a display: none subtree) are not query containers. The size queries are evaluated with the sizes of the containers computed by the layout (a forced layout when the element is in a size container). |
| OnChange | Gets or sets the event handler of the change event. |
| Query | Gets the serialized container conditions, or the empty string when the query is invalid. |
Matches
ContainerQueryList.csGets whether one of the container conditions is true for the element; false when the element is not connected. The ancestors that generate no box (in a display: none subtree) are not query containers. The size queries are evaluated with the sizes of the containers computed by the layout (a forced layout when the element is in a size container).
public bool Matches { get; }Property value
See also
OnChange
ContainerQueryList.csGets or sets the event handler of the change event.
Gets the serialized container conditions, or the empty string when the query is invalid.
public string Query { get; }