Malachi.UI.TokenGen.Emit (malachi v0.22.7)

View Source

Renders the four generated files from a Malachi.UI.TokenGen.Model.

Every renderer reads the model and nothing else, writes tokens in the token file's order, and carries no timestamp, so the same token file always produces the same bytes and the --check gate can compare them.

  • css/1, assets/src/styles/tokens.css: every web token on :root, the themed colors again for dark, one class per density mode, the reduced motion overrides, and the Tailwind v4 @theme inline mapping of every color.
  • rust/1, tui/src/theme/generated.rs: a Palette per color tier and theme over the terminal tokens, and the Surface that theme_background paints.
  • elixir/1, lib/malachi/ui/tokens.ex: Malachi.UI.Tokens, every value resolved.
  • snapshot/1, docs/design/tokens.snapshot.json: the flat, language neutral view the contract tests compare the other three against.

Summary

Functions

Renders tokens.css.

Renders tokens.ex, formatted the way mix format leaves it.

Renders generated.rs.

Renders tokens.snapshot.json.

Functions

css(model)

Renders tokens.css.

elixir(model)

@spec elixir(Malachi.UI.TokenGen.Model.t()) :: String.t()

Renders tokens.ex, formatted the way mix format leaves it.

rust(model)

Renders generated.rs.

snapshot(model)

@spec snapshot(Malachi.UI.TokenGen.Model.t()) :: String.t()

Renders tokens.snapshot.json.