Vixen
dd8b0a81
csharp
public readonly record struct UtilityCandidate

One class name, taken apart.

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

Fields and properties (10)

  • public string Original

    The class name as written, which is also the selector it emits.

  • public IReadOnlyList<string> Variants

    The hover:, md:, [&>*]: prefixes, in order.

  • public string Name

    The utility name — p, bg, flex.

  • public string Value

    Its value — 4, accent, [37px] — or empty.

  • public bool Negative

    Whether it was written with a leading -. A property of the value rather than of the family, because -mt-4 sets exactly what mt-4 sets and differs only in sign.

  • public string? Arbitrary

    The contents of […], when the value is one — and the value half of an arbitrary property, and the var(…) that bg-(--brand) was shorthand for.

  • public float? Opacity

    The /50 suffix read as an opacity, or null.

  • public string? SlashSuffix

    The /50 suffix as written. Kept as well as Opacity because the two readings of a slash are genuinely different: bg-accent/50 is half-transparent, and w-2/3 is two thirds wide, which as an opacity would be three percent. Which one a slash means is the utility's to decide, not the parser's.

  • public bool Important

    Whether it ended in !.

  • public string? Property

    The CSS property named by an arbitrary property — the mask-type of [mask-type:luminance] — or null for every other candidate. ⚠ A separate field rather than a Name that happens to look like a property, because the two are read by different tables and confusing them is the bug. Name is a key into UtilityFamilies' registry; this is a property name to emit verbatim, and there is by construction no family for it. A candidate with a Property has an empty Name and its value in Arbitrary.

Methods (1)

  • public UtilityCandidate(string Original, IReadOnlyList<string> Variants, string Name, string Value, bool Negative, string? Arbitrary, float? Opacity, string? SlashSuffix, bool Important, string? Property = null)

    One class name, taken apart.

Used by (9)

  • ApplyExpanderVixen.Ui.Styling.Utilities
  • ArbitraryPropertyTestsVixen.Ui.Styling.Utilities.Tests
  • ParityLedgerVixen.Ui.Styling.Utilities.Tests
  • ShadowedFamilyTestsVixen.Ui.Styling.Utilities.Tests
  • UtilityConsumptionProbeVixen.Ui.Styling.Utilities.Tests
  • UtilityFamiliesVixen.Ui.Styling.Utilities
  • UtilityFixtureVixen.Ui.Styling.Utilities.Tests
  • UtilityGeneratorVixen.Ui.Styling.Utilities
  • UtilityParserVixen.Ui.Styling.Utilities