feat: consume-tokens example + stdlib sitecheck CI#10
Open
Pattermesh wants to merge 1 commit into
Open
Conversation
Add the canonical "drop tokens.css in and you're on-brand" reference and a zero-dependency checker that guards the static site on push/PR. - examples/consume-tokens/: a small settlement-monitor app built purely from the published var(--*) tokens — imports only tokens.css, no page.css, no component library. Linked from the root "use" section and the components dashboard. - tools/sitecheck.py: pure-stdlib checker — HTML well-formedness (tag balance + single doctype), internal-link integrity (relative href/src + in-page and cross-page fragments resolve on disk), and tokens-wired (any page using var(--token) must link a stylesheet that resolves to tokens.css). - tools/test_sitecheck.py: 27 pytest cases, good- and bad-case per check, plus a gate that asserts the real tree is clean. - .github/workflows/sitecheck.yml: runs the checker CLI then pytest on push/PR. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two additions to the brand kit, both vanilla / zero-framework:
1. A worked consumer example —
examples/consume-tokens/The canonical "drop
tokens.cssin and you're on-brand" reference. A small settlement-monitor app (header, metric cards, status table, button row, alert) built purely from the publishedvar(--*)custom properties. It imports onlytokens.css— nopage.css, no component library — and every rule in its own thin stylesheet reaches for a token first. Linked from the root use section and added as a tile in the components dashboard (pages/index.html).2. A static-site checker + CI —
tools/sitecheck.py,.github/workflows/sitecheck.ymlA pure-stdlib Python checker (no dependencies) that walks every
.htmlfile and asserts:<!doctype>, every non-void element that opens also closes;href/srcand in-page / cross-page#fragmentpoints at something that exists on disk (externalhttp/mailto///links are out of scope);var(--token)must<link>a stylesheet that resolves totokens.css(directly or via a sibling sheet that pulls it in) — the one bug a design-system site must never ship.The check functions return problem lists so they're unit-testable.
tools/test_sitecheck.pyhas 27 pytest cases (good- and bad-case per check) plus a gate asserting the real tree is clean. The workflow runs the checker CLI then pytest on push/PR.Tests
Verified the gate has teeth: deliberately breaking the example's
tokens.csslink makessitecheck.pyexit 1 with broken-link, unresolved-stylesheet, and tokens-not-wired errors.🤖 Generated with Claude Code