fix(bricks): add missing *-strong status swatches to variable-picker hex map - #189
Conversation
The five status strong tokens (success-strong, warning-strong,
error-strong, info-strong, danger-strong) were absent from
resolve_semantic_tokens() — every other status variant (subtle, muted,
and the family base token) had a swatch, but *-strong showed as plain
text in the variable picker.
Adds a loop that mirrors the light-mode CSS formula
oklch(from var(--sf-color-{family}-light) calc(l - offset) c h)
directly in PHP for each status family with its own offset
(-0.15 success, -0.25 warning, -0.10 error/info/danger), producing
deep saturated swatches that make the strong variants visually
distinct from their muted/subtle siblings.
https://claude.ai/code/session_01JLvpeyEzNZtgc7TVjVMhzu
|
Warning Review limit reached
More reviews will be available in 40 minutes and 3 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 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR extends the color resolver to generate strong variants of status colors by computing new ChangesStatus Color Strong Variants
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 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)
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. Comment |
…election text
Adds hex entries for all 11 --sf-color-{family}-light source tokens
(they map to the same oklch-to-hex value as the family base), and adds
--sf-color-selection-text and --sf-color-mark-text (both inherit the
current text colour, so we approximate with the dark-text constant).
Before this change, 13 colour tokens in the inventory showed the
checkerboard "no colour" swatch in the Bricks variable picker.
https://claude.ai/code/session_01JLvpeyEzNZtgc7TVjVMhzu
Summary
The five status
*-strongtokens appeared as plain text in the Bricks variable-picker dropdown while every other variant for the same family (-subtle,-muted, the base family token) had a colored swatch.Root cause:
resolve_semantic_tokens()inclass-color-resolver.phpgenerated*-subtleand*-mutedfor status families but never*-strong— strong variants are explicitly computed tokens in CSS, not step aliases, so they needed their own generation code.Fix: Adds a loop that mirrors the light-mode CSS formula:
Resulting swatches (default palette):
--sf-color-success-strongoklch(0.330 0.17 150)— deep green--sf-color-warning-strongoklch(0.500 0.17 80)— dark amber--sf-color-error-strongoklch(0.520 0.20 35)— deep red-orange--sf-color-info-strongoklch(0.380 0.15 240)— dark blue--sf-color-danger-strongoklch(0.380 0.24 12)— deep redAll five produce clearly distinct, saturated swatches that are visually darker than the base family token — matching the "strong = emphasis/accessible contrast" semantic intent.
Test plan
*-strongentry now shows a colored swatch (deep/saturated, darker than the base family color)*-subtleand*-mutedswatches are unchangedhttps://claude.ai/code/session_01JLvpeyEzNZtgc7TVjVMhzu
Generated by Claude Code
Summary by CodeRabbit