Repository navigation
feat(cli): rewrite theme command as interactive scaffold + add theme vibe tests - #222
Merged
Merged
Conversation
…vibe tests Rewrites `npx xds theme` from a broken theme-discovery command into an interactive scaffold that generates complete, customizable theme files. Also adds 8 theme-customization prompts + 2 holdout prompts to the vibe test harness, based on friction points identified in #155. Theme CLI changes: - Fix --list to scan packages/theme/src/ (where themes actually live) - Add interactive wizard with @clack/prompts (brand colors, mode, overrides) - Add non-interactive mode: npx xds theme default --output ./myTheme.stylex.ts - Add color derivation from accent color (~60 tokens auto-generated) - Add optional component style override scaffolding (button, card, heading, text) - Generate setup instructions with XDSTheme provider code Vibe test additions (theme-customization category): - tc-1: Dark mode toggle - tc-2: Custom brand theme creation - tc-3: Wash background not applying (display:contents gap) - tc-4: Theme switcher with multiple themes - tc-5: Component-level style overrides (declare module pattern) - tc-6: Settings page with live theme controls - tc-7: Nested themes (dark sidebar + light content) - tc-8: Brutalist theme creation Closes #155 (theme scaffold recommendation) Co-authored-by: Navi <[email protected]>
cixzhang
force-pushed
the
navi/feat/theme-scaffold-and-vibe-tests
branch
from
February 20, 2026 06:19
af688c7 to
ebcee5a
Compare
Adds `npx xds docs theme` covering: - XDSTheme provider setup and props - Creating custom themes (scaffold CLI + manual) - Light/dark mode (automatic, toggle, single-mode) - Nesting themes (dark sidebar pattern) - Page background (display:contents workaround) - Component style overrides (declare module pattern) - useXDSTheme hook Also updates AGENTS.md injection to reference the new docs topic. Co-authored-by: Navi <[email protected]>
Contributor
PR Analysis Report📚 Storybook PreviewNo new or modified components detected. Bundle Size Summary
Accessibility AuditStatus: 50 accessibility violation(s) found. XDSAspectRatio - 1 issue(s)
XDSAvatar - 1 issue(s)
XDSBadge - 1 issue(s)
XDSBreadcrumbs - 1 issue(s)
XDSButton - 1 issue(s)
XDSCalendar - 1 issue(s)
XDSCard - 2 issue(s)
XDSCenter - 1 issue(s)
XDSCheckboxInput - 1 issue(s)
XDSCloseButton - 1 issue(s)
XDSDateInput - 1 issue(s)
XDSDialog - 1 issue(s)
XDSDivider - 1 issue(s)
XDSDropdownMenu - 1 issue(s)
XDSEmptyState - 1 issue(s)
XDSField - 1 issue(s)
XDSFontWrapper - 1 issue(s)
XDSGrid - 1 issue(s)
XDSHStack - 1 issue(s)
XDSHeading - 1 issue(s)
XDSHoverCard - 1 issue(s)
XDSIcon - 1 issue(s)
XDSLayout - 2 issue(s)
XDSLink - 1 issue(s)
XDSNumberInput - 1 issue(s)
XDSProgressBar - 2 issue(s)
XDSRadioList - 1 issue(s)
XDSSection - 2 issue(s)
XDSSelector - 1 issue(s)
XDSSkeleton - 1 issue(s)
XDSSlider - 1 issue(s)
XDSSpinner - 1 issue(s)
XDSStackItem - 1 issue(s)
XDSStatusDot - 1 issue(s)
XDSSwitch - 1 issue(s)
XDSTabList - 1 issue(s)
XDSTable - 1 issue(s)
Selection - 1 issue(s)
XDSText - 2 issue(s)
XDSTextArea - 1 issue(s)
XDSTextInput - 1 issue(s)
XDSTimeInput - 1 issue(s)
XDSTooltip - 1 issue(s)
XDSTopNav - 1 issue(s)
XDSVStack - 1 issue(s)
Generated by PR Enrichment workflow | Storybook | View full report |
cixzhang
added a commit
that referenced
this pull request
Apr 26, 2026
…vibe tests (#222) * feat(cli): rewrite theme command as interactive scaffold + add theme vibe tests Rewrites `npx xds theme` from a broken theme-discovery command into an interactive scaffold that generates complete, customizable theme files. Also adds 8 theme-customization prompts + 2 holdout prompts to the vibe test harness, based on friction points identified in #155. Theme CLI changes: - Fix --list to scan packages/theme/src/ (where themes actually live) - Add interactive wizard with @clack/prompts (brand colors, mode, overrides) - Add non-interactive mode: npx xds theme default --output ./myTheme.stylex.ts - Add color derivation from accent color (~60 tokens auto-generated) - Add optional component style override scaffolding (button, card, heading, text) - Generate setup instructions with XDSTheme provider code Vibe test additions (theme-customization category): - tc-1: Dark mode toggle - tc-2: Custom brand theme creation - tc-3: Wash background not applying (display:contents gap) - tc-4: Theme switcher with multiple themes - tc-5: Component-level style overrides (declare module pattern) - tc-6: Settings page with live theme controls - tc-7: Nested themes (dark sidebar + light content) - tc-8: Brutalist theme creation Closes #155 (theme scaffold recommendation) Co-authored-by: Navi <[email protected]> * docs(cli): add theme system reference to docs command Adds `npx xds docs theme` covering: - XDSTheme provider setup and props - Creating custom themes (scaffold CLI + manual) - Light/dark mode (automatic, toggle, single-mode) - Nesting themes (dark sidebar pattern) - Page background (display:contents workaround) - Component style overrides (declare module pattern) - useXDSTheme hook Also updates AGENTS.md injection to reference the new docs topic. Co-authored-by: Navi <[email protected]> --------- Co-authored-by: Navi <[email protected]>
cixzhang
added a commit
that referenced
this pull request
Jun 21, 2026
…vibe tests (#222) * feat(cli): rewrite theme command as interactive scaffold + add theme vibe tests Rewrites `npx xds theme` from a broken theme-discovery command into an interactive scaffold that generates complete, customizable theme files. Also adds 8 theme-customization prompts + 2 holdout prompts to the vibe test harness, based on friction points identified in #155. Theme CLI changes: - Fix --list to scan packages/theme/src/ (where themes actually live) - Add interactive wizard with @clack/prompts (brand colors, mode, overrides) - Add non-interactive mode: npx xds theme default --output ./myTheme.stylex.ts - Add color derivation from accent color (~60 tokens auto-generated) - Add optional component style override scaffolding (button, card, heading, text) - Generate setup instructions with XDSTheme provider code Vibe test additions (theme-customization category): - tc-1: Dark mode toggle - tc-2: Custom brand theme creation - tc-3: Wash background not applying (display:contents gap) - tc-4: Theme switcher with multiple themes - tc-5: Component-level style overrides (declare module pattern) - tc-6: Settings page with live theme controls - tc-7: Nested themes (dark sidebar + light content) - tc-8: Brutalist theme creation Closes #155 (theme scaffold recommendation) * docs(cli): add theme system reference to docs command Adds `npx xds docs theme` covering: - XDSTheme provider setup and props - Creating custom themes (scaffold CLI + manual) - Light/dark mode (automatic, toggle, single-mode) - Nesting themes (dark sidebar pattern) - Page background (display:contents workaround) - Component style overrides (declare module pattern) - useXDSTheme hook Also updates AGENTS.md injection to reference the new docs topic. ---------
josephfarina
added a commit
that referenced
this pull request
Nov 14, 2026
…1738) [experimental] `astryx experimental theme compile`: a compile or `--check` of an editor theme whose source no longer imports or extends its settings, or names another theme, is refused with the same message `set` gives, so it never writes another theme's files or drops every setting. The app copy's font stylesheet imports the installed `@fontsource` package of every family the built theme uses, the theme's own source included, and compile's note on fonts named but not loaded follows it. A theme build counts the families the theme's own font stylesheet beside its source loads (the app copy's), so a build of the copy's source no longer names them as unloaded. A blank or whitespace-only `--out` is refused. [experimental] `astryx experimental theme editor`: a weight word at the end of a font family's name is part of the name (`Arial Black`, `Archivo Black`, `Segoe UI Semibold` are taken as typed) unless the whole name is no family the editor knows and the name without the word is (`Inter ExtraBold` is Inter and a weight); a weight number (`Inter 600`) is never part of a name. The Segoe UI weights Windows ships as families of their own are on the system font list. [experimental] `astryx experimental theme editor how --help` lists the kinds of ask a question in plain words can be, each with examples it answers with commands (examples labeled "Asks how understands": a dial, a part's property by an amount or a value, a direction, a comparison, everything except some parts, a prohibition, one mode, a removal, several changes, a question about a value). A question it cannot answer points to that list, and `--help` is the first of its next commands. [experimental] `astryx experimental theme editor how` judges a dial step by what it does, never by its own word: "more washed out colors" answers `vibrancy less` again. A typed value waives the way only for what it writes; every other value is still measured the way asked. [experimental] `astryx experimental theme editor how` reads mode phrases, bounds, shadow strength and prohibitions each through one shared reader, and holds every answer to the measured check: "darker … in light mode" gets darker; "weaker" shadows get softer; "at least 2px", "under 40px" and "no bigger than 12px" hold the bound from the value now; "…, in dark mode" and "light mode #eee, dark mode #222" scope each value; "but leave inputs alone", "don't touch inputs" and "keep their hover the same" keep that part or state; kept parts are checked in every variant and level; a token typed with a part stays on that part; "blue card background" is the color, not the blue variant; page gradients keep the colors named; thinner borders step down from the width now; and value questions that name a mode read that mode. [experimental] `astryx experimental theme`: a change no longer deletes a copy of a picture (such as `preview-before.png`): only pictures the editor recorded taking, unchanged since, are removed. Every browser the editor starts for a picture, Playwright included, runs as its own process with a temp folder of its own (removed however the run ends), one 60-second bound and the same stop; a browser that does not start keeps its real cause in the message, and Chrome is named only when there is one. A theme folder that cannot be written is a write failure naming the folder; pictures asked for but not taken are said; `preview add` finds a preview renamed by hand instead of starting a second one, through the one list of previews `see`, a change's refresh and the preview commands share; a theme the route imports from outside the project folder (a workspace app run from its own folder) is never dropped from the preview; the no-template refusal offers only pages the app can show; a page remove over a theme that does not load names the whole-preview remove; the `add --template <default page>` note says what was added; from a subfolder, the wiring's paths work from there; and the `preview remove` help says what happens to a path outside the folder. [experimental] `astryx experimental theme editor`: the check of a theme's own token values judges what a build made now writes, through one path for `show`, `set`, `undo` and `compile`. A value from an import, an expression, a spread or a computed key is judged by its built value; only the value a later key keeps counts; a pair is judged as the `light-dark()` it builds. The source is read only to name the file and line that hold each value (an imported file is named, not the theme file) and for what a build erases: a second `tokens` key, and a pair with other than two values. Typography is judged by the values the build was given: a scale base with a unit (which builds `NaNrem`) is refused with the number of pixels it means, a scale with a ratio and no base is named, a family written in quotes or holding `; { } < >` is refused with the working form, and `fallbacks` is checked as part of the family list it builds. A family set through typography no longer gets the phone note. [experimental] `astryx experimental theme editor`: every value a refusal or a saved-settings repair offers now passes one gate, and each offered line is checked as `set` checks it before it is shown. A value may come only from these sources: - What was typed, under exact readings: quotes, labels and copy debris (a trailing `;`, `!important`, a comment) taken off; the same number written another way (full-width digits, a comma decimal, an exponent, rem or pt as px, a percent); CSS color names written as words (`dark red` is `darkred`). - A documented table: Tailwind's radius classes (`rounded-lg` is 8px), a dial's own words, a weight word, a number read as a dial's nearest rung. - The theme's own saved values, for a keep or unlock line. - The setting's documented fallback or other-direction step. - The correction of a typo of what was typed: one letter off for a word of five letters or fewer, two for a longer one. Anything else, such as a stock color, a stock shadow or easing, a reset, a default token or a nearest guess, gives `how <thing>`. A scale step (`red-500`) is no bare color. Also: - `font 'Inter 600'` offers the family and the weight separately. - A Google Fonts spec (`Inter:wght@400;600`) offers its family. - Another property's label on a part property (`padding 'margin: 8px'`) offers that property. - `--color-danger` offers the error token, and `--color-primary` or `--color-brand` the accent token. - A CSS property typed for the whole theme leads with its dial or token (`border-radius 8px` → `corners 8px`), never a part that was not named. - A pasted object's nested values are read, and each of its lines is checked. - A bare fraction on a size token gets no px guessed. - A very long input is near nothing. - `--state 'hover,focus-visible'` gives one line per state. - A saved light-dark pair for one mode is refused with the half for that mode. - A CSS-wide keyword on a token offers the undo only when the theme sets the token. [experimental] `astryx experimental theme editor`: `set <theme> base <name>` with a built-in base that is not installed names its install line, then the same set and the set to no base, in whatever letters the base was typed. In `how`, "a thin border" and "a thick border" name a width (1px and 2px); only "thinner" and "thicker" step from the width the part shows now. [experimental] `astryx experimental theme editor`: a settings entry's `only` written as text (`"false"`, `"true"`) is read as what it says, with a note, and any other value that is not true is refused with the undo that removes that entry, so `show` and the build never disagree. A theme typed after the setting (`set --color-accent '#123457' t`) is refused with the same `set` or `undo` with the theme first, never a `new` of the setting's name. `undo <theme> vibrancy` says the default vibrancy applies now. `new` with several bad dial flags suggests one command that fixes or drops each of them; `new --base` points to `--like`; `show` names a show that works and its help for an option it does not take. The name rule lists every reserved name it refuses (com0-com9, lpt0-lpt9, and com¹-com³, lpt¹-lpt³). corners takes a rem (saved in px), and a bare number gets the px line. Dial words are read in any case (ROOMY, MORE, BOTH). `set t 'corners pill'` is read as the thing and its value. With no theme named in an app with one theme, show and undo name that theme. The compile line in the result works from the folder the command ran in. [experimental] `astryx experimental theme editor`: the refusal of a theme's own token values no longer ends a reason with two periods. [experimental] `astryx experimental theme editor`: one-mode colors in a variant or a state, gradient layers with a color, keywords with a mode, and the corners dial on parts with their own radius. - A one-mode color in a variant or a state (a heading level, a hover) keeps the theme's own value around it in the other mode: the variant's resting color, then the part's, then the whole theme's, as the theme finally has it. A later brand color reaches the other mode. - In a one-mode background, a color written beside a gradient (`#f00 linear-gradient(…)`) is that mode's background color, and the gradient its image. - A CSS-wide keyword (`unset`, `inherit`) takes no `--mode`; the offered command sets it for both modes. - The corners dial reaches parts whose base theme gives them a radius of their own, and a corners step on a part starts from the radius the part shows. - A one-mode color on a part says that, in the other mode, it overrides what Core or the base theme gives the part in context. - `how` lists the margins a part reads among its spacing, as `set` reads them. [fix] `astryx theme build` refuses a blank or whitespace-only `--out` (it wrote files named by the spaces alone), and its note on fonts named but not loaded leaves out the families a local theme's own font stylesheet loads (`<slug>.fonts.css` beside the source, the stylesheet `theme add` imports). `astryx theme build` and `astryx doctor` also treat Segoe UI Light, Semilight, Semibold and Black as system fonts, the faces Windows installs as families of their own, so neither reports them as not loaded.
This was referenced Nov 21, 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.
Summary
Rewrites
npx xds themefrom a broken theme-discovery command into an interactive scaffold that generates complete, customizable theme files. Addsnpx xds docs themewith comprehensive theme system documentation. Also adds theme-customization prompts to the vibe test harness based on #155 friction points.Theme CLI
The old
themecommand scannedpackages/core/src/theme/for theme files — but themes live inpackages/theme/src/. It always errored with "No themes found."The new command is an interactive scaffold that generates a complete
.stylex.tstheme file.npx xds theme --listnpx xds theme --helpNon-interactive:
npx xds theme defaultInteractive mode:
npx xds themeWalks through:
Generated file
The output is a complete, self-contained theme file with:
createTheme()calls with correct type casts@xds/core/theme/tokens.stylexTheme Docs (
npx xds docs theme)New reference doc covering:
createThemepattern)light-dark(), toggle button, single-mode)display: contentsworkaround)declare modulepattern, available slots)useXDSThemehookTests
Vibe Tests
Added 8
theme-customizationprompts + 2 holdout prompts totest-sets/default.json, based on friction points from #155:Vibe test results (5 prompts, with
npx xds docs theme)Before/after comparison: theme docs impact
Ran the same 5 prompts before and after adding
npx xds docs theme:Key findings:
npx xds docs themeas their primary reference for theming tasksdeclare module+ gradient border pattern directly from the theme docs instead of reverse-engineering from sourcedisplay: contentsworkaround from the "Page Background" sectionFull 8-prompt run (iteration e3ce5e6d)
Relates to #155
Crafted with care by Navi