Repository navigation
feat: theme studio: presets, colour roles, live preview, apply to site - #562
Merged
Merged
Conversation
mvilacad
force-pushed
the
feat/560-feat-theme-studio-theme-as-a
branch
from
October 25, 2026 03:42
0167c19 to
a22e1d4
Compare
mvilacad
marked this pull request as ready for review
October 25, 2026 03:42
mvilacad
force-pushed
the
feat/560-feat-theme-studio-theme-as-a
branch
from
October 25, 2026 06:11
a22e1d4 to
c0d4385
Compare
Replaces the /theme/ editor with a Theme Studio built on the real engine: looks gallery, per-scheme colour roles with contrast readouts, fonts, shape, type roles, motion, surface picker, eight preview screens at 390/768/1280 with a light/dark comparison, undo/redo, share URL, apply to site (visitor only), prompt and logo generation, and an AI export prompt. Lib: ColorField, SliderField, Slider label, public colour helpers, designDefaults, presetContrastIssues export.
Charts read tokens from <html>, so a chart inside a data-theme-scope or data-preset island painted the page's colors. ChartScope and ThemeIsland now provide the island as the scope; chartTokens and chartPalette read from it. Studio dashboard uses the real charts. Landing hero follows its frame.
mvilacad
force-pushed
the
feat/560-feat-theme-studio-theme-as-a
branch
from
October 25, 2026 09:28
c0d4385 to
bd37a5b
Compare
This was referenced Oct 25, 2026
mvilacad
added a commit
that referenced
this pull request
Oct 25, 2026
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.
Closes #560
Theme Studio
/theme/is now a full editor on the real engine (ThemeOptions,presetContrastIssues,colorScheme), built only from lib components. Every control maps 1:1 onto aThemeOptionskey; nothing is invented by the studio.data-styleCSS, recipe, elevation, paper, noise), Shape (radius, control radius, density, borders, icon stroke), Type (curated fonts with live Google Fonts load, pairs, scale, line height, weights, tracking, per-role type), Motion and button tokens.chartTokens/chartPaletteread from the island,ChartScopeandThemeIslandprovide it; the dashboard uses the real charts.designDefaults()), so it shows what a fresh app gets, not this site's sketchbook.theme.ts, CSS, SvelteKit and Astro wiring, share URL (#t=v1.…, round-trips), "For AI" prompt.ca-site-studio, replayed by an inline script before paint, kept last in the cascade. No key means sketchbook; nothing touches the published theme, build output or lib defaults. "Reset to sketchbook" clears it.Lib additions
ColorField,SliderField,Slider label,@codeatlasdev/ui/utils/color(parseColorInput,contrast,wcagLevel,toHex,toOklch,extractPalette,pickBrand),designDefaults,presetContrastIssues/presetTokens/BUILTIN_PRESETSexports. Demos 988-990, docs, css-api, changeset.tweakcn vs ours
theme.ts, CSS, wiring for Kit and AstroNot matched: community theme hosting and accounts (out of scope, no backend), and real overlays inside the preview.
Tests
color.test.ts,theme-studio.test.ts(state, codec, history, looks, prompt,extractCode),theme-defaults.test.ts(keepsdesignDefaultsin lockstep withtokens.css).ColorField,SliderField.Also in this PR
stateFromRecipe(id, recipeSurface, preset)(studio-state.ts): the state of a bare design recipe, for style pages that apply a recipe to the site. Compiles to exactlydesignStyle(id)(test per recipe)..cache/studio/(560-landing-390-dark.png,560-landing-390-light.png,560-overlays-static-390.png).