Malachi.UI.Tokens (malachi v0.22.7)

View Source

The design tokens, for any page the server renders itself.

Generated from docs/design/design-tokens.json by mix malachi.tokens; change the token file and regenerate rather than editing this module. Every value is the CSS a stylesheet would write for that token in that theme, with every reference already resolved, since a page rendered here has no stylesheet cascade to resolve a var() against.

Summary

Types

A token: its type and its CSS value in each theme.

Functions

Every token, by name.

A token's CSS value in a theme, or :error for a name that is not a token.

Every token name, in the token file's order.

Types

token()

@type token() :: %{type: atom(), light: String.t(), dark: String.t()}

A token: its type and its CSS value in each theme.

Functions

all()

@spec all() :: %{required(String.t()) => token()}

Every token, by name.

get(name, theme)

@spec get(String.t(), :light | :dark) :: {:ok, String.t()} | :error

A token's CSS value in a theme, or :error for a name that is not a token.

names()

@spec names() :: [String.t()]

Every token name, in the token file's order.