Skip to content

feat: standalone token configurator app - #285

Merged
jackgranatowski merged 3 commits into
mainfrom
feat/standalone-configurator
Jun 9, 2026
Merged

feat: standalone token configurator app#285
jackgranatowski merged 3 commits into
mainfrom
feat/standalone-configurator

Conversation

@jackgranatowski

Copy link
Copy Markdown
Contributor

This pull request was created by @kiro-agent on behalf of @jackgranatowski 👻

Comment with /kiro fix to address specific feedback or /kiro all to address everything.
Learn about Kiro Web


Summary

Adds configurator/ — a standalone Svelte 5 + Vite panel that lets anyone generate SLASHED override CSS for every framework token/knob, without any build step or backend.

Inspired by the existing WordPress admin-app Svelte panel in the SLASHED-Plugins repo, but fully decoupled from WordPress and expanded to cover the entire token surface (802 tokens) rather than a curated subset.

What it does

  • Lists all --sf-* tokens grouped by category and source section, with tier badges (public / advanced / internal), descriptions, alias info, and framework defaults shown as placeholders.
  • Per-token smart editors: color picker/swatch for colors, numeric & length inputs where appropriate, text otherwise.
  • Search across names/descriptions/values/namespaces; filter by tier or "modified only".
  • Live preview applying every framework default + your overrides to a scoped sample UI (light/dark toggle) so light-dark() and relative oklch(from …) resolve like production.
  • Generates @layer slashed.overrides { :root { … } } (or bare :root) with only changed tokens. Copy / download / re-import an existing sheet. Overrides persist to localStorage.

Auto-sync with the framework API

The token catalogue is never hand-maintained. configurator/scripts/sync-api.mjs derives it from the framework's generated docs/api-index.json and writes src/data/api-index.generated.json. It runs:

  • as the final step of the framework npm run docs pipeline (new configurator:sync script), and
  • on the configurator's own predev / prebuild.

So any token added/renamed/retiered/re-valued in the CSS flows into the panel on the next build with zero manual edits.

Testing

  • npm install && npm run build in configurator/ — clean production build (129 modules).
  • npm run sync regenerates the catalogue (802 tokens, framework v0.5.24).
  • Pre-commit hooks (commitlint, stylelint, artifact check) pass; configurator/** excluded from the framework stylelint since the UI uses its own --cfg-* chrome variables.

Notes / follow-ups

  • Could add a GitHub Pages deploy workflow for the built dist/ if you want a public hosted configurator.
  • Native color picker is used only for plain-hex defaults; non-hex colors (oklch/light-dark) use a text input + resolved swatch.

Add configurator/ — a standalone Svelte 5 + Vite panel that lets anyone
generate SLASHED override CSS for every framework token/knob, with live
preview and copy/download/import.

The token catalogue is auto-synced from the framework's generated
docs/api-index.json via configurator/scripts/sync-api.mjs, wired into the
docs pipeline (configurator:sync) and the app's predev/prebuild, so the
panel never drifts from the framework API.

Exclude configurator/ from the framework stylelint (it uses its own --cfg-*
chrome variables, not --sf-* tokens).

Co-authored-by: Jack Granatowski <contact@codeslash.net>
@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@jackgranatowski, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 4 minutes and 56 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 07fc7ebc-b046-45d0-b8e7-40c3bba05415

📥 Commits

Reviewing files that changed from the base of the PR and between a24e3e5 and 72336ba.

⛔ Files ignored due to path filters (1)
  • configurator/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (26)
  • .github/workflows/deploy-configurator.yml
  • .stylelintrc.json
  • configurator/.gitignore
  • configurator/README.md
  • configurator/index.html
  • configurator/jsconfig.json
  • configurator/package.json
  • configurator/scripts/sync-api.mjs
  • configurator/src/App.svelte
  • configurator/src/components/Header.svelte
  • configurator/src/components/OutputPanel.svelte
  • configurator/src/components/Preview.svelte
  • configurator/src/components/Sidebar.svelte
  • configurator/src/components/TokenEditor.svelte
  • configurator/src/components/TokenGroup.svelte
  • configurator/src/components/TokenRow.svelte
  • configurator/src/data/api-index.generated.json
  • configurator/src/lib/css.js
  • configurator/src/lib/model.js
  • configurator/src/lib/preview.js
  • configurator/src/lib/store.svelte.js
  • configurator/src/main.js
  • configurator/src/styles/app.css
  • configurator/svelte.config.js
  • configurator/vite.config.js
  • package.json
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/standalone-configurator

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

Comment @coderabbitai help to get the list of available commands and usage tips.

Builds configurator/ and publishes its static dist/ to GitHub Pages on
merges to main touching the app or docs/api-index.json, plus manual
dispatch. Actions are SHA-pinned per repo convention; permissions follow
least-privilege with the deploy job scoped to pages:write + id-token:write.
Address PR review findings:
- sync-api.mjs: guard JSON.parse with an actionable error, fail loudly on an
  empty/collapsed token set, and replace the per-run generatedAt wall-clock
  stamp with a stable content hash so the committed catalogue only changes
  when tokens actually change.
- css.js: sanitize override values (strip top-level ;{} and comment markers)
  so a value can't break out of the :root block or desync round-trip import;
  teach parseCSS to track quote state so quoted parens don't derail scanning.
- store: sanitize on load/set/import; surface a localStorage write failure via
  a storage.ok flag instead of swallowing it silently.
- OutputPanel: warn when persistence is unavailable.
- Sidebar: search placeholder now shows the catalogue total, not the filtered
  count.
- Header: drop the removed generatedAt reference; show catalogue hash.
@jackgranatowski
jackgranatowski merged commit 4d6fb51 into main Jun 9, 2026
11 checks 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.

2 participants