From 542324fe5c2f6811873b373ce6638ca79bb34fba Mon Sep 17 00:00:00 2001 From: Alex Dunmow Date: Sat, 4 Jul 2026 14:42:41 +0800 Subject: [PATCH] feat(colors): exempt templates/email/*.ninjatpl from the hardcoded-color check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mail clients don't support CSS custom properties — themed email wrappers (codeless WO-WZ-021) inline resolved {{ colors.* }} hex with hex fallbacks by necessity. Co-Authored-By: Claude Fable 5 --- colors.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/colors.go b/colors.go index 31dd62a..6e9199a 100644 --- a/colors.go +++ b/colors.go @@ -254,6 +254,13 @@ func checkNinjaTplColors(root string) []colorViolation { if strings.Contains(path, "/vendor/") || strings.Contains(path, "/.git/") { return nil } + // Email wrapper templates (templates/email/*.ninjatpl) legitimately + // require literal hex: mail clients don't support CSS custom + // properties, so themed emails inline resolved theme colors + // ({{ colors.* }}) with hex fallbacks (WO-WZ-021). + if strings.Contains(filepath.ToSlash(path), "/templates/email/") { + return nil + } relPath, _ := filepath.Rel(root, path) if relPath == "" {