Repo-local design guard CLI (scan staged files for hardcoded CSS values).
npm install @jacquesramphal/design-guardRepo-local “design guard” CLI to detect hardcoded design values in staged files.
- Hardcoded lengths: px, rem, em, %, vw, vh, etc.
- Hardcoded colors: hex (#fff, #ffffff, …) and rgb()/rgba()/hsl()/hsla()
It’s intended to nudge code toward using design tokens (e.g. CSS variables like var(--size-5)).
Install (recommended):
``bash`
npm i -D @jacquesramphal/design-guard
Run (scans staged files only):
`bash`
npx design-guard --verbose
By default, it reads design-guard.config.json from your git repo root if present; otherwise it uses the package default config.
You can create a starter config:
`bash`
npx design-guard --init
- Ignore a line: add design-guard:ignoredesign-guard:off`
- Ignore a whole file: add