Skip to content

feat: diagram styles as JSON standard - #9

Merged
lam0819 merged 2 commits into
mainfrom
feat/diagram-styles-json
Nov 19, 2026
Merged

lam0819 merged 2 commits into
mainfrom
feat/diagram-styles-json

Conversation

@lam0819

@lam0819 lam0819 commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add diagram-styles.json + diagram-styles.schema.json (format: flow-explainer.diagram-styles) as the canonical style pack.
  • Embed styles into index.html / 3d.html with npm run styles:sync so pages stay standalone (no runtime fetch).
  • Publish JSON + schema on GitHub Pages; check:sync verifies JSON ↔ HTML ↔ 3d.html.

This is step 1 toward custom user styles — the file format first, not in-browser JSON loading yet.

Test plan

  • npm run check passes
  • Settings still lists Original / Teal / Line / Blueprint / Glass / Circuit
  • Change a colour in diagram-styles.json, run npm run styles:sync, confirm both pages update
  • npm run check:sync fails if HTML is edited by hand out of sync with JSON
  • After merge/deploy: https://solutionforest.github.io/flow-explainer/diagram-styles.json returns 200

Made with Cursor

solutionforestteam and others added 2 commits November 19, 2026 11:32
Make diagram-styles.json (+ schema) the source of truth, embed it into the pages via sync-styles so they stay standalone, and publish the files on GitHub Pages.

Co-authored-by: Cursor <cursoragent@cursor.com>
Easier to edit and review; pack.json sets order, sync rebuilds the published bundle and embeds into the pages.

Co-authored-by: Cursor <cursoragent@cursor.com>
@lam0819

lam0819 commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

Follow-up: styles are now one file per style under diagram-styles/ (original.json, teal.json, … + pack.json for order). diagram-styles.json is generated by npm run styles:sync.

@lam0819
lam0819 merged commit 9beb576 into main Nov 19, 2026
1 check passed
@lam0819
lam0819 deleted the feat/diagram-styles-json branch November 19, 2026 03:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants