feat: improve color system DX with dark-mode fallback and theme-aware palette - #26
Conversation
… palette - Add dark-mode fallback to all 11 resolved color tokens so dark mode falls back to the light value when no explicit -dark override is set - Replace literal white/black with var(--sf-color-base)/var(--sf-color-text) in palette color-mix() calls to make tint/shade scale theme-aware (fixes #24) - Update THEMOWANIE documentation to reflect the new 6-token override model
Drop all @Property -dark registrations and their initial-values. Dark mode now auto-derives from the -light source via CSS relative color syntax: clamp(0.65, 0.95 - l*0.5, 0.88) lightens brand colors; base inverts with clamp(0.16, 1.18 - l, 0.24). Setting --sf-color-X-dark (now an unregistered custom property) still works as a full per-mode override — var() fallback fires only when the developer hasn't touched it. Direction-dependent derived tokens (text, borders, status-strong) now reference the resolved --sf-color-neutral / --sf-color-X tokens instead of the removed -dark source tokens. API surface: quick branding → override 6 -light tokens, done full control → also set -dark (no @Property required) https://claude.ai/code/session_015xq1jY8LgWAuyKQJmCM8L7
…ctor tokens.palette.css: tints/shades now mix with --sf-color-base/text (not white/black) — update token naming comment to match. demo.html: theme customizer description no longer says "falls back to the same values" — dark mode now auto-derives via relative color syntax. https://claude.ai/code/session_015xq1jY8LgWAuyKQJmCM8L7
|
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)
📝 WalkthroughWalkthroughThis PR refactors the dark-mode color token system from explicit per-mode ChangesToken derivation and palette theming
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
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)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@optional/tokens.palette.css`:
- Around line 115-118: The four tokens --sf-color-base-100 through
--sf-color-base-400 are mixing var(--sf-color-base) with itself so they all
collapse to the same value; update the color-mix calls in those variables to mix
the base color with a neutral target (e.g., white `#fff` for lighter ramps or
black `#000` for darker ramps) instead of var(--sf-color-base), or alternatively
compute lighter/darker OKLCH variants by adjusting lightness directly;
specifically change the second argument in the color-mix(in oklch,
var(--sf-color-base) X%, ...) calls from var(--sf-color-base) to an appropriate
neutral (like `#fff`) and tweak the percentages for the intended ramp.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: dc06c2a5-f08e-42a2-b5cc-1e8740509bde
⛔ Files ignored due to path filters (1)
dist/slashed.essential.cssis excluded by!**/dist/**
📒 Files selected for processing (3)
core/tokens.cssdocs/demo.htmloptional/tokens.palette.css
--sf-color-base-100 through -400 were mixing var(--sf-color-base) with itself, producing no scale (all values equal to base). Fix: mix var(--sf-color-text) into var(--sf-color-base) at increasing percentages (8%→65%), creating a grayscale that steps from near-base toward text — consistent with the shade scale (600–900) and theme-aware in both light and dark mode. Caught by CodeRabbit review on PR #25. https://claude.ai/code/session_015xq1jY8LgWAuyKQJmCM8L7
falls back to the light value when no explicit -dark override is set
in palette color-mix() calls to make tint/shade scale theme-aware (fixes fix(palette): tints/shades mix with theme-aware tokens instead of literal white/black #24)
Summary by CodeRabbit
Refactor
New Features
Documentation