mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-15 23:12:04 +00:00
build(lint): ban raw palette colors and guard the design contract
Add the healthlog/no-raw-palette-color rule so UI code routes color through the semantic tokens instead of Tailwind palette shades, and sweep the remaining offenders (password-strength scale, injection-site accents, redundant dark overrides). Add guard tests for width stability, the single page-header vocabulary, and motion-reduce coverage on indefinite animations.
This commit is contained in:
1 parent
fda0e504f0
commit
ba8118546d
12 files changed
+312
-26
No files matched your search
@@ -10,16 +10,17 @@ interface PasswordStrengthProps {
|
||||
minLength?: number;
|
||||
}
|
||||
|
||||
// The bar fill stays vivid (it's a non-text indicator), but the label text
|
||||
// routes through the AA-tuned semantic tokens — the raw Tailwind 500 tones
|
||||
// failed contrast against the white card. Weakest is destructive, the middle
|
||||
// band warning, the strong band success.
|
||||
// Both the bar fill and the label route through the AA-tuned semantic tokens
|
||||
// — the raw Tailwind 500 tones failed contrast against the white card and
|
||||
// drift off the app's token vocabulary. Weakest two bands are destructive,
|
||||
// the middle band warning, the strong two bands success; fill and text share
|
||||
// the same tone per score so the meter reads as one signal.
|
||||
const SCORE_COLORS = [
|
||||
{ color: "bg-red-500", textColor: "text-destructive" },
|
||||
{ color: "bg-orange-500", textColor: "text-destructive" },
|
||||
{ color: "bg-yellow-500", textColor: "text-warning" },
|
||||
{ color: "bg-green-500", textColor: "text-success" },
|
||||
{ color: "bg-emerald-600", textColor: "text-success" },
|
||||
{ color: "bg-destructive", textColor: "text-destructive" },
|
||||
{ color: "bg-destructive", textColor: "text-destructive" },
|
||||
{ color: "bg-warning", textColor: "text-warning" },
|
||||
{ color: "bg-success", textColor: "text-success" },
|
||||
{ color: "bg-success", textColor: "text-success" },
|
||||
];
|
||||
|
||||
export function PasswordStrength({
|
||||
|
||||
Reference in new issue
Block a user