public static class ContainerQueryEvaluates the size conditions in a @container prelude.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
The same grammar as MediaQuery over a different subject, and a deliberately smaller feature set. A container query asks about a box, so the features it may use are the ones a box has: CSS Containment 3 § 5.2 lists width, height, inline-size, block-size, aspect-ratio and orientation, and nothing else.
⚠ Refusing the media-only features is the point rather than an omission. @container (prefers-color-scheme: dark) is not a container query, and the alternative to refusing it is answering it from whatever surface the element happens to be on — a rule that reads as though it were scoped to the panel and is not. Every refusal here names the feature, and the loader turns it into the same diagnostic an unreadable @media gets.
⚠ An axis the container does not constrain makes the container ineligible, and the query asks the next one up (#1429). Asking (min-height: 200px) of an inline-size container is asking about a number the containment did not make well-defined — the box's height is still its content's. CSS Containment 3 § 5.1 does not answer that false: the container a query asks is the nearest ancestor that is a valid query container for every feature in it, so the inline-size box is skipped and a size container above it answers. Requires is what the walk in ContainerConditions reads to skip it. This evaluator still reads such a feature as unknown rather than reading the height anyway, but the walk never hands it that box; false is only right when no eligible container exists at all.
Methods (1)
public static bool TryEvaluate(string? condition, ContainerBox box, out bool matches, out string? reason)Evaluates a container condition against a box.
Used by (3)
- ContainerConditionsVixen.Ui.Styling
- ContainerQueryTestsVixen.Ui.Styling.Tests
- StyleSheetLoaderVixen.Ui.Styling