Extract reusable components from DESIGN.md#4
Merged
Conversation
The DESIGN.md parser pulled colors, typography, spacing, and radius tokens but ignored the "Component Styling" section. Add extractComponents, which builds button/card/badge component skeletons from whatever fill, text color, padding, radius, border, and font props it can find, falling back to sensible defaults. Presets now carry an optional components map; apply_preset copies them into canvas.components so they can be instanced.
4 tasks
vicmaster
added a commit
that referenced
this pull request
May 15, 2026
Phase 5 item #4: root document fills + centers the viewport
vicmaster
added a commit
that referenced
this pull request
May 17, 2026
Phase 8 #4: 'path' node type for custom SVG paths
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.
Summary
extractComponents, which detectsbutton/card/badgedescriptions (sub-section heading or list item), pulls whateverfill/ text color /padding/cornerRadius/border/fontSize/fontWeightit can find via regex, and buildscomponentSceneNode skeletons with sensible defaults for anything missing.Presetgains an optionalcomponentsmap.apply_presetcopies those intocanvas.components(structured-cloned) so they're instanceable;import_design_mdreports the extracted component keys.Test plan
npm run buildcleannpx tsx test-design-md.ts— 28/28 checks pass (13 color-filter, 13 component-extraction, 2 instanced-render)instancenode referencing an extractedbuttonresolves and renders its fill + label viarenderToHtml