fix(demo): show auto-derived dark colors in the configurator - #32
Merged
Conversation
Dark pickers were seeded from a hardcoded TOKEN_DEFAULTS table that didn't even match the framework's derivation, implying dark must be set manually and hiding the auto-derive feature. Now each picker reads the resolved --sf-color-X from a mode-pinned probe, so dark reflects the live auto-derived value and tracks -light edits; a -dark override is written only when a dark picker is changed. Randomize sets only -light and lets dark derive. https://claude.ai/code/session_01MoV2rAESh77QMzsc4kL3fo
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe Theme Customizer JavaScript is refactored to dynamically resolve CSS token colors using hidden probe elements per theme mode, replacing hardcoded defaults. A ChangesTheme Customizer Token Resolution Refactoring
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
This was referenced May 29, 2026
Merged
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
Follow-up to #29. The theme configurator's dark color pickers were seeded from a hardcoded
TOKEN_DEFAULTStable, which:oklch(0.70 0.15 264)where the formula yieldsoklch(0.725 0.18 264)), and-lighttokens.Now each picker reads the resolved
--sf-color-Xfrom a hidden, mode-pinned probe, so:--sf-color-X-darkoverride is written only when you actually change a dark picker — auto-derivation stays in effect until you deliberately opt out.@propertydefault, dark returns to auto-derive).-lightand lets dark derive, demonstrating single-input branding.Removed the misleading hardcoded
-darkdefaults (and the now-unused light oklch table); kept a small hex fallback for engines that can't resolveoklch. Net −43 lines,docs/demo.htmlonly.Test plan
docs/demo.html:primarypicker shows#6ba0ff= resolvedoklch(0.725 0.18 264)(the real derived value)--sf-color-primary-darkinline override on:rootat loadprimary→ dark picker updates live, still no-darkoverride writtennpm run lint:css,npm run build,npm test(14/14) all greenhttps://claude.ai/code/session_01MoV2rAESh77QMzsc4kL3fo
Generated by Claude Code
Summary by CodeRabbit
Bug Fixes
Improvements