Pote.Validator.Theme (Pote v3.0.0)

Copy Markdown View Source

Theme color name validation.

Splits out theme-specific validation from Pote.Validator.

Not part of the public API — used only by Pote.Validator.

Summary

Functions

Returns error message for theme validation errors.

Validates a theme color name (any valid Elixir-like identifier).

Functions

error_message(atom)

@spec error_message(atom()) :: String.t()

Returns error message for theme validation errors.

validate(color_name)

@spec validate(String.t()) :: :ok | {:error, atom()}

Validates a theme color name (any valid Elixir-like identifier).

Accepts any string matching ~r/^[a-zA-Z_][a-zA-Z0-9_]*$/ as a valid theme color name (the actual color is resolved at runtime from the active theme).