Commit 9afbea3
ci: fail on references to undefined CSS custom properties
A typo'd CSS custom property (e.g. var(--pg-input-normal-hover) where the
real token is --pg-input-hover) does not error — it silently falls back to
currentColor or an invalid value — so it slips through review. This adds a
stylelint check that flags any var(--…) pointing at a token that is never
defined, and wires it into the Lint CI job (npm run lint:css).
The check is intentionally scoped to the single
csstools/value-no-unknown-custom-properties rule (no base config) so it
only guards this bug class without a noisy retrofit. The --pg-* tokens live
in global.scss, whose SCSS syntax the plugin's importFrom loader can't
parse, so the config parses that file with postcss-scss and feeds the
resolved token set to the plugin inline (stays in sync automatically).
Enabling it surfaced five pre-existing undefined tokens, all fixed here
(intended values recovered from git history):
--pg-input-normal-hover -> --pg-input-hover (input :hover border)
--pg-primary-rgb -> defined as 48, 149, 222 (RGB of --pg-primary)
--pg-hard-background -> --pg-general-background (was originally `white`)
--pg-input-normal-light -> --pg-input-normal (file-row separators)
These were rendering wrong (transparent/invalid/currentColor); the fixes
restore the intended appearance.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 21abd88 commit 9afbea3
7 files changed
Lines changed: 1582 additions & 7 deletions
File tree
- .github/workflows
- src/lib
- components/filesharing/inputs
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
| |||
0 commit comments