Vixen
dd8b0a81
csharp
public static class ContainerQuery

Evaluates 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 is a refusal to match, not a false. 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 — so the query cannot be answered here. It answers false rather than reading the height anyway, which is what a browser does when no eligible container is found.

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