Skip to content

Commit 9afbea3

Browse files
rubenhensenclaude
andcommitted
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/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- run: npx svelte-kit sync
3232
- run: npx svelte-check --threshold warning
3333

34-
# Run prettier --check and eslint.
34+
# Run prettier --check, eslint, and stylelint.
3535
lint:
3636
name: Lint
3737
runs-on: ubuntu-latest
@@ -44,6 +44,8 @@ jobs:
4444
- run: npm ci
4545
- run: npx svelte-kit sync
4646
- run: npm run lint
47+
# Fail on references to undefined CSS custom properties (e.g. typo'd --pg-* tokens).
48+
- run: npm run lint:css
4749

4850
# Create a GitHub release (and tag) when conventional commits warrant one.
4951
release-please:

0 commit comments

Comments
 (0)