Static linter that enforces the PhiaUI theming contract on component templates.
Rules
No arbitrary hex colors — classes like
bg-[#000]ortext-[#1a2b3c]are forbidden. Use semantic tokens instead (bg-background, etc.).No hardcoded Tailwind palette classes — classes like
text-zinc-900orbg-slate-100couple components to a specific palette, breaking dark-mode and theming. Usetext-foreground,bg-card, etc.
Usage
# Check a string of class content
PhiaUi.TemplateLinter.check_content(~s(class="bg-primary text-foreground"))
# => :ok
PhiaUi.TemplateLinter.check_content(~s(class="bg-[#000] text-zinc-900"))
# => {:error, ["Forbidden hardcoded hex: bg-[#000]", ...]}
# Scan all component templates
PhiaUi.TemplateLinter.scan_templates()
# => :ok | {:error, [{file, [violation]}]}
Summary
Functions
Checks a string of template content for theming violations.
Scans all *.ex files under priv/templates/components/ and returns
:ok or {:error, [{file_path, [violation]}]}.
Functions
Checks a string of template content for theming violations.
Returns :ok or {:error, [violation_message]}.
Scans all *.ex files under priv/templates/components/ and returns
:ok or {:error, [{file_path, [violation]}]}.