feat(server): bake a snippet kit into every snippet doc#6
Merged
Conversation
Element defaults (button/input/select/textarea matching the viewer, accent-color on toggles), SVG utility classes (t/ts/th presets, box, arr, leader, node, c-* color ramps with dark-aware text), and a shared context-stroke arrow marker injected into every doc. The design guide documents it as a compact reference table; the demo JWT diagram rewritten with the kit is 46% smaller. Co-Authored-By: Claude Fable 5 <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
Bakes a "snippet kit" into every snippet document so agents publish compact markup instead of hand-writing inline CSS for every button, slider, and diagram label — fewer output tokens means faster publishes, and snippets get a consistent look for free.
button,input,select,textareaare pre-styled to match the viewer (hover/focus included); checkboxes, radios, ranges, and progress bars are themed viaaccent-color.color-scheme: light darkmakes native controls render dark automatically.t/ts/thtext presets,box(neutral rect,rx: 8via CSS),arr(1.2px connector),leader(dashed guide),node(cursor + hover dim), andc-blue|teal|amber|coral|green|red|graycolor ramps that set fill+stroke on shapes (or a whole<g>, including descendant.boxrects) and auto-switch child<text>to readable ink in light and dark. Blue/amber/green/red/gray alias the existing semantic tokens; teal and coral get their own light/dark variable pairs.<marker id="arrow">is injected into every doc;fill="context-stroke"makes the arrowhead inherit each line's stroke, so one marker replaces per-color marker defs.Reviewer notes
svg text(fill/font-size) — that would silently break existing snippets that usefill="..."orfont-size="..."attributes. There's a comment insnippetPage.tspinning this constraint.context-strokeneeds Chrome 119+ / Safari 18+; older browsers would render a black arrowhead.npm test(49), both typecheck programs, lint, format, and e2e (10/10, chromium + webkit) all pass.🤖 Generated with Claude Code