Brand profile resolution for generated auth UI and transactional emails.
Sigra keeps branding constrained to validated tokens. The generated host app can still take full control by editing its generated templates and CSS.
Summary
Functions
Returns resolved auth colors for a light or dark generated auth theme.
Turns a profile into inline CSS variables for generated auth previews/pages.
Deletes the generated global admin-managed profile so config/defaults take over.
Returns a Swoosh-compatible {name, address} tuple when an address exists.
Builds a profile from config and optional generated defaults.
Loads the global admin-managed profile, if the generated table exists.
Resolves a brand profile from defaults, Sigra.Config/keyword config, and
the optional generated global admin profile.
Persists the global admin-managed profile in the generated host app table.
Functions
@spec color_tokens(Sigra.Branding.Profile.t(), :light | :dark) :: map()
Returns resolved auth colors for a light or dark generated auth theme.
@spec css_variables(Sigra.Branding.Profile.t()) :: String.t()
Turns a profile into inline CSS variables for generated auth previews/pages.
@spec delete_global(Sigra.Config.t() | keyword() | map()) :: :ok | {:error, term()}
Deletes the generated global admin-managed profile so config/defaults take over.
@spec email_from(Sigra.Branding.Profile.t()) :: {String.t(), String.t()} | String.t()
Returns a Swoosh-compatible {name, address} tuple when an address exists.
@spec from_config(Sigra.Config.t() | keyword() | map() | nil, keyword() | map()) :: Sigra.Branding.Profile.t()
Builds a profile from config and optional generated defaults.
@spec load_global( Sigra.Config.t() | keyword() | map() | nil, keyword() ) :: {:ok, Sigra.Branding.Profile.t()} | {:error, term()}
Loads the global admin-managed profile, if the generated table exists.
@spec resolve( Sigra.Config.t() | keyword() | map() | nil, keyword() ) :: Sigra.Branding.Profile.t()
Resolves a brand profile from defaults, Sigra.Config/keyword config, and
the optional generated global admin profile.
Runtime profile lookup is best-effort. If the table is absent or unavailable, Sigra falls back to config/default tokens rather than breaking pre-auth pages.
@spec save_global(Sigra.Config.t() | keyword() | map(), keyword() | map(), keyword()) :: {:ok, Sigra.Branding.Profile.t()} | {:error, term()}
Persists the global admin-managed profile in the generated host app table.