Vixen
02b45cc4
csharp
public sealed class ThemeTokens

The design tokens every generated utility is measured in.

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

Remarks

The whole argument for a utility system is here rather than in the generator: "accent is now teal" is one line of one file, and the editor's two hundred components follow. That is what makes this worth building instead of hand-writing CSS, and it applies more strongly to one monolithic application than it ever did to a website.

Tokens are data, deliberately — a YAML asset rather than a config script. It can be hot-reloaded, diffed, and edited by a live theme editor, none of which is true of code.

Fields and properties (11)

  • public const string DefaultKey

    The key a colour family uses for its unqualified form.

  • public Dictionary<string, string> Colors

    Colours, keyed by their utility suffix — surface-1, accent.

  • public Dictionary<string, float> Radius

    Corner radii in pixels, keyed by suffix.

  • public Dictionary<string, string> Shadow

    Shadows, as the box-shadow text they stand for, keyed by suffix.

  • public Dictionary<string, FontSizeToken> FontSize

    Font sizes, keyed by suffix.

  • public Dictionary<string, float> FontWeight

    Font weights, keyed by suffix.

  • public Dictionary<string, float> Screens

    Breakpoint widths in pixels, keyed by variant name.

  • public float SpacingBase

    The spacing unit. p-4 is four of these.

  • public DarkModeStrategy DarkMode

    How a dark theme is selected.

  • public List<string> Content

    The globs to scan for utilities in use.

  • public List<string> Diagnostics

    Everything that could not be read, and why.

Methods (2)

  • public static ThemeTokens Parse(string yaml)

    Reads a vixen.ui.yaml.

  • public bool TryGetColor(string name, out string value)

    Looks a colour up, allowing for the DEFAULT shade.

Used by (6)

  • ApplyExpanderVixen.Ui.Styling.Utilities
  • ThemeAndScannerTestsVixen.Ui.Styling.Utilities.Tests
  • UtilityFamiliesVixen.Ui.Styling.Utilities
  • UtilityFixtureVixen.Ui.Styling.Utilities.Tests
  • UtilityGeneratorVixen.Ui.Styling.Utilities
  • VariantsVixen.Ui.Styling.Utilities