Vixen
dd8b0a81
csharp
public static class UtilityFamilies

The utilities a class name can name, and what each one emits.

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

Remarks

Table-driven, because the interesting part of a utility system is not any individual utility — it is that adding one is a line of data rather than a branch. The families are the set [doc 09](../../docs/plan/09-ui-framework.md) names for 1.0: what an editor actually needs, which is a good deal less than what Tailwind ships.

Two utilities genuinely collide and the collision is resolved by the token tables. text- is font size, colour, and alignment: text-lg, text-accent and text-center are three different properties behind one prefix. So text- resolves in order — keyword, then font-size token, then colour — and the consequence is worth knowing before someone hits it: a colour named center would be unreachable through text-. The same applies to border-, which is width or colour.

Methods (5)

  • public static (string Name, string Value) SplitName(string whole)

    Splits a utility into the longest registered family name and the rest.

  • public static bool IsRegistered(string name)

    Whether a name is one the registry holds.

  • public static string? ScopeOf(string name)

    What a family's rule is about, when it is not the element carrying the class.

  • public static IReadOnlyList<string> Surface(ThemeTokens tokens)

    Every class name that reaches a distinct part of what the families can emit.

  • public static bool TryResolve(UtilityCandidate candidate, ThemeTokens tokens, List<UtilityDeclaration> declarations)

    Turns a parsed candidate into the declarations it stands for.

Used by (11)

  • ApplyExpanderVixen.Ui.Styling.Utilities
  • ArbitraryPropertyTestsVixen.Ui.Styling.Utilities.Tests
  • ChildScopedFamilyTestsVixen.Ui.Styling.Utilities.Tests
  • ParityLedgerVixen.Ui.Styling.Utilities.Tests
  • RefusalExpiryVixen.Ui.Styling.Utilities.Tests
  • ShadowedFamilyTestsVixen.Ui.Styling.Utilities.Tests
  • UtilityConsumptionProbeVixen.Ui.Styling.Utilities.Tests
  • UtilityFixtureVixen.Ui.Styling.Utilities.Tests
  • UtilityGeneratorVixen.Ui.Styling.Utilities
  • UtilityParserVixen.Ui.Styling.Utilities
  • UtilityFamilySupportTestsVixen.Editor.Ui.Tests