Vixen
dd8b0a81
csharp
public readonly record struct StyleRule

One rule: a selector, the declarations it applies, and where it sits in the cascade.

No guide page documents this yet — the page shows what the code says about itself.

Fields and properties (8)

  • public Selector Selector

    Its compiled selector.

  • public DeclarationRange Declarations

    The declarations it applies.

  • public StyleOrigin Origin

    Who it came from.

  • public int Layer

    Its cascade layer, or Unlayered.

  • public int Order

    Its position in source order across every stylesheet loaded.

  • public bool BlocksSharing

    Whether matching it can depend on something a StyleSharingKey does not carry. See SharingIsSound.

  • public int Conditions

    The @media group it was written inside, or Unconditional. ⚠ On the rule rather than resolved away at load, which is what lets two windows of one document answer max-width differently. The loader used to evaluate the condition and either emit the rules or drop them, which put the answer in the rule set — and the rule set is shared by every surface, so the question could be asked once and was asked of the primary window. See MediaConditions.

  • public int Containers

    The @container group it was written inside, or Unconditional. ⚠ A second, independent id rather than another value in , because the two conditions are about different subjects and both have to hold. @media (min-width: 900px) { @container (min-width: 400px) { … } } asks one question of the window and one of a box; a single tagged chain would have to interleave two verdict tables to answer it, and each table is already a conjunction that evaluates in one ascending pass on its own.

Methods (1)

  • public StyleRule(Selector Selector, DeclarationRange Declarations, StyleOrigin Origin, int Layer, int Order, bool BlocksSharing, int Conditions, int Containers)

    One rule: a selector, the declarations it applies, and where it sits in the cascade.

Used by (6)

  • ClassSelectorReachTestsVixen.Ui.Styling.Tests
  • CombinatorPairTestsVixen.Ui.Styling.Tests
  • StyleInvalidatorVixen.Ui.Styling
  • StyleResolverVixen.Ui.Styling
  • StyleRuleSetVixen.Ui.Styling
  • TypeSelectorReachTestsVixen.Ui.Styling.Tests