Skip to content

feat(themes): add a theme creator on a labelled mock of the current app - #133

Merged
nolight132 merged 27 commits into
mainfrom
feat/theme-creator
Nov 29, 2026
Merged

nolight132 merged 27 commits into
mainfrom
feat/theme-creator

Conversation

@nolight132

@nolight132 nolight132 commented Nov 29, 2026 •

Copy link
Copy Markdown
Member

Summary

  • add a theme creator at /themes/creator that labels every colour where the live app mock paints it
  • light up every place a token is used when its label or row is hovered
  • show a menu, a dialog, toasts, a tooltip and every row and field state under the mock, each part named by its tokens
  • start from any built-in or community theme, or import a theme file or sonora:// link
  • shift the hue, saturation and lightness of every colour at once, and edit each colour and its opacity
  • make up to eight variants of one theme and save them as a file, a zip, an install link or a gallery submission
  • flag text and icons below 4.5:1 or 3:1 against what they sit on
  • refuse to submit a theme whose text reads below 3:1, in the creator, the submit form and the worker
  • lay the mock's page on the chrome as an edged sheet the way Sonora does now, with Sonora's current palettes and status colours
  • link the creator from the gallery, the theme preview and the theme docs

theme-creator

theme-creator-readability

Before

mock-before

After

mock-after

@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Explain Change →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 52 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Summary

Adds a theme creator at /themes/creator to edit, import, and export Sonora themes. It also adds token labels, contrast checks that refuse submissions with text below 3:1, shared color utilities, and updated app mock styling.

The changes add color parsing, conversion, adjustment, compositing, and contrast utilities, plus shared theme token data. A new theme creator supports editing variants, importing themes, and downloading, sharing, or submitting them. The mock accepts custom colors, and TokenMap scans it to show token usage. Theme pages and documentation link to the creator and use shared token groups. Readability checks also run in the creator and submission paths.

Merge Risk: Low · previous review 2fb61 · assessed changes only

Path filters excluded changed files. This rating applies only to the assessed changes.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

Comment thread src/lib/components/TokenMap.svelte Resolved
Comment thread src/lib/components/TokenMap.svelte Resolved
Comment thread src/routes/themes/creator/+page.svelte Resolved
Comment thread src/routes/themes/creator/+page.svelte Resolved
Comment thread src/routes/themes/creator/+page.svelte Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 8

Comment thread src/lib/components/Specimens.svelte Resolved
Comment thread src/lib/components/TokenMap.svelte Resolved
Comment thread src/lib/components/TokenMap.svelte Resolved
Comment thread src/lib/scheme.svelte.ts Resolved
Comment thread src/lib/theme-tokens.ts Resolved
Comment thread src/lib/theme-tokens.ts Resolved
Comment thread src/routes/themes/creator/+page.svelte Resolved
Comment thread src/routes/themes/creator/+page.svelte Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

Comment thread src/lib/theme-tokens.ts Resolved
Comment thread src/routes/themes/creator/+page.svelte Resolved
Comment thread src/routes/themes/creator/+page.svelte Resolved
Comment on lines +365 to +373
const spot = document.querySelector('.marks .ring');
if (!spot || !canvas) return;
const view = canvas.getBoundingClientRect();
const box = spot.getBoundingClientRect();
if (box.top >= view.top && box.bottom <= view.bottom) return;
canvas.scrollBy({
top: box.top + box.height / 2 - (view.top + view.height / 2),
behavior: 'smooth'
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor · Functional Correctness · Quick win

Bring the located token into view when the canvas does not scroll.

At 1100px and below, .canvas has overflow: visible and position: static. The canvas rect then spans the whole mock. The check at Line 369 always passes, so the function returns early. canvas.scrollBy never runs. The .view block is shown above the panel (column-reverse). A tap on a token row therefore highlights a ring that stays off-screen. Nothing visibly happens.

When canvas.scrollHeight <= canvas.clientHeight, call spot.scrollIntoView({ block: 'center', behavior: 'smooth' }) instead. Keep canvas.scrollBy for the wide layout.

Comment thread src/routes/themes/creator/+page.svelte Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Comment thread src/lib/mock/player.svelte.ts Resolved
@nolight132
nolight132 merged commit 3fb7963 into main Nov 29, 2026
1 check passed
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.

1 participant