Skip to content

refactor(api): rename source tokens -light/-dark → -source-light/-source-dark, merge error into danger, add sf-section--guttered - #387

Merged
jackgranatowski merged 7 commits into
mainfrom
claude/design-system-api-feedback-xmomho
Jun 24, 2026
Merged

refactor(api): rename source tokens -light/-dark → -source-light/-source-dark, merge error into danger, add sf-section--guttered#387
jackgranatowski merged 7 commits into
mainfrom
claude/design-system-api-feedback-xmomho

Conversation

@jackgranatowski

@jackgranatowski jackgranatowski commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Three API improvements based on design system feedback:

  1. Source token rename: --sf-color-X-light → --sf-color-X-source-light
    (and -dark → -source-dark) for all 6 brand + 4 status families.
    Eliminates the naming collision with shade aliases (-lighter, -xlight,
    -superlight) that implied a lightness scale when -light was actually
    a mode input. Resolved semantic tokens (--sf-color-primary etc.) unchanged.

  2. Merge error → danger: --sf-color-error is now an alias for --sf-color-danger.
    danger covers both destructive actions and form-validation errors.
    Removes --sf-color-error-source-light/dark as standalone customisation knobs.
    All --sf-color-error-* derived tokens (subtle/muted/strong/text--on-error)
    kept as backwards-compatible aliases. .is-invalid and .is-error states
    updated to reference danger tokens directly.

  3. Add .sf-section--guttered: adds padding-inline: var(--sf-gutter) to a
    section, enabling gutter-less layouts without a nested .sf-container.

Migration notes added to docs/migration.md.

Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_015eRstwpktwGixBeiKTKhkk

Summary by CodeRabbit

  • New Features
    • Added .sf-section--guttered for consistent section gutter padding without double-guttering.
  • Breaking Changes
    • Renamed brand color tokens from -light/-dark to -source-light/-source-dark across the system.
    • Replaced “error” status colors with “danger” throughout, including removing error-related token variants and updating status visuals/states accordingly.
    • Updated the theming/token override workflow and demos to use the new source-based naming and danger palette.
  • Docs / Tests
    • Regenerated token/class references and updated examples, plus adjusted automated checks to match the new token names and danger status behavior.

@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Review Change Stack

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 27 minutes and 16 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ 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.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

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: 05f36dd7-83d3-4884-8b88-ab591bac5b73

📥 Commits

Reviewing files that changed from the base of the PR and between 5dfbc6c and dc5819c.

📒 Files selected for processing (2)
  • core/themes.css
  • tests/baseline-modern.json
📝 Walkthrough

Walkthrough

Renames all color source knob tokens from *-light/*-dark to *-source-light/*-source-dark across the entire codebase. Removes the --sf-color-error status family, replacing it with --sf-color-danger. Adds the .sf-section--guttered layout utility and removes .sf-surface--error. The token registry CI gate is updated to permit intentional name renames. All changes propagate through optional CSS, the configurator, tests, and documentation.

Changes

SLASHED 0.7.0 Color System Migration

Layer / File(s) Summary
Core CSS token contracts and layout
core/tokens.css, core/themes.css, core/states.css, core/macros.css, core/motion.css, core/layout.css
Renames all brand/status @property source tokens and :root mirrors from *-light/*-dark to *-source-light/*-source-dark; updates all light-dark() and oklch() derivations in themes.css for lumlocker and data-theme blocks; switches .is-invalid/.is-error to consume --sf-color-danger instead of --sf-color-error; removes .sf-surface--error and its @supports cascade entry; updates sf-color-pulse keyframe animation to target --sf-color-primary-source-light; adds .sf-section--guttered modifier with nested .sf-container padding override.
Optional CSS consumers
optional/forms.css, optional/components.css, optional/config-example.css, optional/theme-example.css, optional/tokens.palette.css
Switches validation styling from --sf-color-error to --sf-color-danger in forms; updates badge and alert danger variant token references in components; renames all six master brand knobs in quick-rebrand, dark-mode override, and scoped-brand palette examples to *-source-light/*-source-dark; updates numeric-scale doc example from error-300 to danger-300.
Configurator source
configurator/src/lib/brandColors.js, configurator/src/lib/themes.js, configurator/src/components/BrandColorRow.svelte, configurator/src/components/DomainPanel.svelte, configurator/src/components/Preview.svelte, configurator/src/styles/app.css
Removes error from BRAND_COLOR_KEYS status group; updates preset override keys in all three presets to *-source-light; updates $derived variable name construction for light/dark override tracking; updates hasBrandOverride helper to check *-source-light/*-source-dark CSS variables; replaces all error identifiers with danger in Preview status arrays, form state demos, and CSS classes; switches configurator chrome danger colors from error to danger tokens.
Token registry and CI gate
token-registry.json, configurator/src/data/token-registry.generated.json, scripts/check-token-registry.js
Renames source token entries from *-dark/*-light to *-source-dark/*-source-light (preserving token IDs); marks the entire --sf-color-error family (dark/light/muted/strong/subtle) and --sf-color-text--on-error with removed: true for backward compatibility; removes the id-name-invariant check from CI gate to permit intentional renames via in-place name updates.
Test suite
tests/auto-color.spec.js, tests/color-semantic.spec.js, tests/baseline-modern.json, tests/token-api.snapshot.json, tests/demo-a11y-panel.spec.js, tests/demo-visual.spec.js, tests/tier1-p7-oldengine.test.js, tests/tier1-p8-modern.spec.js, tests/tokens.spec.js, tests/link-contrast.spec.js, configurator/tests/*, configurator/tests-e2e/*
Removes error surface from contract tests; updates status opacity list to exclude error; updates dark override tests to use *-source-light/*-source-dark; removes error-token entries from baseline/snapshot JSON; reduces a11y pair count and changes Text on error to Text on danger; updates expected status swatch count from 5 to 4; swaps error for danger in token sampling; updates all configurator test token key references and e2e selectors.
Documentation and generated artifacts
README.md, docs/migration.md, docs/theming.md, docs/llm-guide.md, docs/architecture.md, docs/demo.html, docs/token-annotations.json, docs/api-index.json, docs/api-index.md, docs/token-index.json, docs/token-index.md, docs/tokens.md, docs/classes.md, docs/registry.json, docs/test-coverage-*.html, configurator/src/data/api-index.generated.json
Adds comprehensive 0.6.x→0.7.0 migration guide covering source-token rename, error→danger swap, and .sf-section--guttered introduction; updates all documentation examples to *-source-light/*-source-dark naming; removes error-family token entries; adds .sf-section--guttered macro documentation and removes .sf-surface--error; regenerates all JSON/markdown indices with updated token counts, registered knob formulas, and computed derivations.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • codeslash-dev/SLASHED#40: Introduced the sf-color-pulse animation in core/motion.css targeting --sf-color-primary-light, which this PR renames to --sf-color-primary-source-light.
  • codeslash-dev/SLASHED#55: Introduced the optional/forms.css required-field and :user-invalid styling consuming --sf-color-error, which this PR replaces with --sf-color-danger.
  • codeslash-dev/SLASHED#386: Modified .sf-surface--* variant logic in core/macros.css including error/danger surface variants, which this PR removes (.sf-surface--error) and updates in the @supports cascade selector.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the three main changes: source token rename, error-to-danger consolidation, and the new section utility class.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/design-system-api-feedback-xmomho

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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a2eab656fd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread core/tokens.css
@property --sf-color-tertiary-light { syntax: "<color>"; inherits: true; initial-value: oklch(0.42 0.22 295); }
@property --sf-color-action-light { syntax: "<color>"; inherits: true; initial-value: oklch(0.50 0.22 235); }
@property --sf-color-neutral-light { syntax: "<color>"; inherits: true; initial-value: oklch(0.52 0.025 260); }
@property --sf-color-primary-source-light { syntax: "<color>"; inherits: true; initial-value: oklch(0.47 0.27 264); }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Migrate the configurator color editor names

After this source-token rename, the configurator's BrandColorRow.svelte still builds --sf-color-${colorKey}-light / --sf-color-${colorKey}-dark dynamically and setOverride accepts those names, so editing any color in the main Colors panel now exports dead custom properties instead of changing --sf-color-*-source-light/source-dark. Update that editor (and its key list) along with the token rename so the live preview and generated CSS actually affect the new source tokens.

Useful? React with 👍 / 👎.

Comment thread core/tokens.css
--sf-color-success: var(--sf-color-success-source-light);
--sf-color-warning: var(--sf-color-warning-source-light);
--sf-color-info: var(--sf-color-info-source-light);
--sf-color-danger: var(--sf-color-danger-source-light);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve error token aliases

Only the danger token is published here after removing the --sf-color-error* declarations. In projects that already use var(--sf-color-error), --sf-color-error-subtle/muted/strong, or --sf-color-text--on-error, those references now resolve as missing instead of mapping to danger, despite the merge being described as an alias in the code/comments. Keep the old error custom properties as aliases to the corresponding danger tokens to avoid breaking existing consumers.

Useful? React with 👍 / 👎.

@jackgranatowski
jackgranatowski force-pushed the claude/design-system-api-feedback-xmomho branch 2 times, most recently from b182c92 to 88a7817 Compare June 23, 2026 21:12
@jackgranatowski

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 9

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
configurator/src/data/api-index.generated.json (1)

7076-7077: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Keep the legacy error alias in the published index.

Line 7076 removes --sf-color-text--on-error, but the PR objective says the error family should remain as backwards-compatible aliases. Publishing only the danger names breaks consumers that still resolve the old API surface.

Based on the PR objective: the error family should remain as backwards-compatible aliases.

🤖 Prompt for 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.

In `@configurator/src/data/api-index.generated.json` around lines 7076 - 7077, The
change is removing the `--sf-color-text--on-error` entry from the
api-index.generated.json file, which breaks backwards compatibility for
consumers still using the legacy error naming convention. According to the PR
objective, the error family should remain as backwards-compatible aliases
alongside the new danger naming. Restore the `--sf-color-text--on-error` entry
and all other legacy error family aliases in the published index to maintain the
complete API surface for existing consumers.
core/macros.css (1)

221-226: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Correct the named surface variant count.

After removing .sf-surface--error, this section lists 10 precomputed variants, not 11.

📝 Proposed fix
-     contextual surface tokens. 11 precomputed variants
+     contextual surface tokens. 10 precomputed variants
🤖 Prompt for 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.

In `@core/macros.css` around lines 221 - 226, The documentation comment for the
Surface macro incorrectly states there are "11 precomputed variants" when there
are actually only 10 after the removal of `.sf-surface--error`. Update the
number in the comment block that begins with "/* -- Surface" to reflect the
correct count of 10 precomputed variants.
🤖 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 `@core/themes.css`:
- Around line 99-112: Update all comments associated with the color variable
declarations to reflect the new naming convention. In the CSS theme file, find
the comments near the declarations for --sf-color-primary, --sf-color-secondary,
--sf-color-tertiary, and --sf-color-action (around lines 99-112 and 180-184) and
replace references to the old naming pattern (such as `-light`, `-dark`, and
`--sf-color-X-dark`) with references to the new `--sf-color-*-source-light` and
`--sf-color-*-source-dark` format to ensure consumers have accurate guidance on
which variables to override.

In `@core/tokens.css`:
- Around line 10-12: The comments at lines 10-12 describe the source-dark tokens
as unregistered and optional, but the actual `@property` registrations for
--sf-color-*-source-dark tokens are defined at lines 211-220, making the
comments outdated and misleading. Update the comments at lines 10-12 and also at
lines 161-163 to accurately reflect that these source-dark tokens are now
registered with `@property`, removing any language that suggests they are
unregistered or purely optional overrides. Ensure the comments align with the
actual token registrations present in the file.
- Around line 631-634: The `--sf-color-selection-bg` variable definition in the
dark mode branch (the second argument in the light-dark() function) is
incorrectly using `var(--sf-color-action-source-light)` instead of
`var(--sf-color-action-source-dark)`. Change the color source in the dark
selection oklch() call from `--sf-color-action-source-light` to
`--sf-color-action-source-dark` so that dark mode overrides of the action source
token are properly respected. Also ensure that any section-level redeclaration
of this variable in core/themes.css is updated to match this change.

In `@docs/architecture.md`:
- Line 205: The source color count listed in the property registration
description is incorrect. The text states "18 source colours" but the breakdown
provided (10 -source-light + 10 -source-dark) totals 20, not 18. Update the
count from 18 to 20 to accurately reflect the actual number of source colors in
the 0.7.0 source-token set.

In `@docs/demo.html`:
- Line 2778: The HEX_FALLBACKS object uses outdated key naming with the
`--sf-color-*-light` pattern, but the picker inputs now expect
`--sf-color-*-source-light` and `--sf-color-*-source-dark` data-tokens. Update
all fallback keys in HEX_FALLBACKS by replacing the legacy `-light` suffix with
`-source-light` and add corresponding `-source-dark` entries for each of the 20
color tokens to match the new naming convention used by the picker inputs.
- Around line 803-808: In the sf-cluster div containing the status tiles, there
are two duplicate "Danger" tiles. Remove the second Danger tile that appears
after the Info tile (the div with text "Danger" that uses sf-color-danger-subtle
variables), as it creates a redundant status in the cluster. If a fifth status
indicator is needed, consider replacing it with an appropriate alternative
status type instead of duplicating Danger.

In `@docs/test-coverage-1-colors.html`:
- Around line 293-299: The fourth demo-chip div in the section uses the correct
CSS variables (--sf-color-danger and --sf-color-text--on-danger) but displays
the outdated label text "on-error" instead of "on-danger". Change the visible
text content of this demo-chip from "on-error" to "on-danger" to align with the
tokens being used and match the sixth demo-chip which correctly displays
"on-danger".

In `@docs/test-coverage-4-macros-states.html`:
- Line 105: The demo cell in the HTML file has the CSS class sf-surface--danger
applied to it, but the text content displayed inside the div still reads
"surface--error". Update the text content of this div element to say
"surface--danger" instead, so the label matches the CSS class being
demonstrated.

In `@docs/test-coverage-6-token-reference.html`:
- Line 113: The TOKENS array contains duplicate token name entries which causes
inaccurate counts and duplicate rows in the output. Remove all duplicate entries
from the TOKENS array variable to ensure it contains only unique token names.
You can verify the fix by checking that each token name appears exactly once in
the array.

---

Outside diff comments:
In `@configurator/src/data/api-index.generated.json`:
- Around line 7076-7077: The change is removing the `--sf-color-text--on-error`
entry from the api-index.generated.json file, which breaks backwards
compatibility for consumers still using the legacy error naming convention.
According to the PR objective, the error family should remain as
backwards-compatible aliases alongside the new danger naming. Restore the
`--sf-color-text--on-error` entry and all other legacy error family aliases in
the published index to maintain the complete API surface for existing consumers.

In `@core/macros.css`:
- Around line 221-226: The documentation comment for the Surface macro
incorrectly states there are "11 precomputed variants" when there are actually
only 10 after the removal of `.sf-surface--error`. Update the number in the
comment block that begins with "/* -- Surface" to reflect the correct count of
10 precomputed variants.
🪄 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: f10748ab-fe29-40bb-89b6-d1fe2cc8e688

📥 Commits

Reviewing files that changed from the base of the PR and between 162787a and 88a7817.

⛔ Files ignored due to path filters (2)
  • dist/badge-essential.json is excluded by !**/dist/**
  • dist/badge-optimal.json is excluded by !**/dist/**
📒 Files selected for processing (56)
  • README.md
  • configurator/src/components/BrandColorRow.svelte
  • configurator/src/components/DomainPanel.svelte
  • configurator/src/components/Preview.svelte
  • configurator/src/data/api-index.generated.json
  • configurator/src/data/token-registry.generated.json
  • configurator/src/lib/brandColors.js
  • configurator/src/lib/themes.js
  • configurator/src/styles/app.css
  • configurator/tests-e2e/import-export.spec.js
  • configurator/tests-e2e/preview.spec.js
  • configurator/tests/smoke.test.js
  • configurator/tests/store-history.test.js
  • configurator/tests/themes.test.js
  • core/layout.css
  • core/macros.css
  • core/motion.css
  • core/states.css
  • core/themes.css
  • core/tokens.css
  • docs/api-index.json
  • docs/api-index.md
  • docs/architecture.md
  • docs/classes.md
  • docs/demo.html
  • docs/llm-guide.md
  • docs/migration.md
  • docs/registry.json
  • docs/test-coverage-1-colors.html
  • docs/test-coverage-2-typography.html
  • docs/test-coverage-3-layout.html
  • docs/test-coverage-4-macros-states.html
  • docs/test-coverage-5-forms-features.html
  • docs/test-coverage-6-token-reference.html
  • docs/theming.md
  • docs/token-annotations.json
  • docs/token-index.json
  • docs/token-index.md
  • docs/tokens.md
  • optional/components.css
  • optional/config-example.css
  • optional/forms.css
  • optional/theme-example.css
  • optional/tokens.palette.css
  • scripts/check-token-registry.js
  • tests/auto-color.spec.js
  • tests/baseline-modern.json
  • tests/color-semantic.spec.js
  • tests/demo-a11y-panel.spec.js
  • tests/demo-visual.spec.js
  • tests/link-contrast.spec.js
  • tests/tier1-p7-oldengine.test.js
  • tests/tier1-p8-modern.spec.js
  • tests/token-api.snapshot.json
  • tests/tokens.spec.js
  • token-registry.json
💤 Files with no reviewable changes (1)
  • tests/baseline-modern.json

Comment thread core/themes.css
Comment thread core/tokens.css Outdated
Comment thread core/tokens.css
Comment thread docs/architecture.md Outdated
Comment thread docs/demo.html Outdated
Comment thread docs/demo.html Outdated
Comment thread docs/test-coverage-1-colors.html
Comment thread docs/test-coverage-4-macros-states.html Outdated
Comment thread docs/test-coverage-6-token-reference.html Outdated
claude added 5 commits June 24, 2026 04:18
… add sf-section--guttered

- Rename all 20 --sf-color-X-light/-dark source input tokens to
  --sf-color-X-source-light/-source-dark (10 brand + 10 status families)
  to eliminate naming collision with shade-alias suffixes (-lighter, -xlight, etc.)
- Remove --sf-color-error* family entirely (replaced by --sf-color-danger*)
- Update .is-invalid/.is-error states, .sf-badge--*, .sf-alert--* to use danger tokens
- Add .sf-section--guttered with double-gutter prevention for nested containers
- Update configurator BrandColorRow/DomainPanel/brandColors to use new token names
- Remove --sf-color-error from BrandColorRow colour list
- Relax check-token-registry.js invariant 1: allow intentional in-place renames

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015eRstwpktwGixBeiKTKhkk
- Remove 'error' from status arrays in auto-color, color-semantic, tokens specs
- demo-a11y-panel: 13→12 pairs, swap 'Text on error' for 'Text on danger'
- demo-visual: fix count 5→4 status swatches, fix bgs.size 5→4
- demo.html: remove duplicate danger swatches (color row + surfaces grid)
- demo.html: add sf-section--guttered demo for coverage test
- demo.html: update status text copy (error → danger/warning)
Update badge sizes and api-index hash to reflect current build state
post-rebase onto main (v0.6.11).
… configurator

- Rename --sf-color-*-light → --sf-color-*-source-light in all
  test-coverage :root blocks (files 1-6)
- Fix demo.html code example snippet and animation description text
  to reference --sf-color-primary-source-light (motion.css already
  animates the source-light token)
- Fix Preview.svelte code example snippet
- Fix test-coverage-6 Array.from(new Set([..."])) closing parens
- Fix test-coverage-4/1 surface--danger/on-danger label text
- Update tests/token-api.snapshot.json to post-rename sort order
- Fix core/tokens.css: dark branch of --sf-color-selection-bg uses
  --sf-color-action-source-dark; fix stale comments
- Fix core/themes.css stale -light/-dark comments
- Fix core/macros.css: 11→10 precomputed variants comment
- Fix docs/architecture.md: 18→20 source colours
…facts

Document all 10 --sf-color-*-source-dark tokens in sections 5.2 and 5.3
of docs/llm-guide.md. Regenerate api-index, token-index, and tokens.md
after build.
@jackgranatowski
jackgranatowski force-pushed the claude/design-system-api-feedback-xmomho branch from 88a7817 to 5dfbc6c Compare June 24, 2026 04:19

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/test-coverage-1-colors.html (1)

237-246: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Remove duplicated danger entries from the status demo rows.

Line 237 and Line 246 were migrated from error→danger, but each row already contains another danger item, so status coverage now duplicates one status and drops variety.

Proposed fix
       <div class="demo-swatch-row">
         <div class="demo-swatch" style="background: var(--sf-color-success)">success</div>
         <div class="demo-swatch" style="background: var(--sf-color-warning)">warning</div>
         <div class="demo-swatch" style="background: var(--sf-color-danger)">danger</div>
         <div class="demo-swatch" style="background: var(--sf-color-info)">info</div>
-        <div class="demo-swatch" style="background: var(--sf-color-danger)">danger</div>
       </div>
@@
       <div class="sf-cluster sf-cluster--m">
         <div class="demo-chip" style="background: var(--sf-color-success-subtle); color: var(--sf-color-success-strong); border: 1px solid var(--sf-color-success-muted)">Success</div>
         <div class="demo-chip" style="background: var(--sf-color-warning-subtle); color: var(--sf-color-warning-strong); border: 1px solid var(--sf-color-warning-muted)">Warning</div>
         <div class="demo-chip" style="background: var(--sf-color-danger-subtle); color: var(--sf-color-danger-strong); border: 1px solid var(--sf-color-danger-muted)">Danger</div>
         <div class="demo-chip" style="background: var(--sf-color-info-subtle); color: var(--sf-color-info-strong); border: 1px solid var(--sf-color-info-muted)">Info</div>
-        <div class="demo-chip" style="background: var(--sf-color-danger-subtle); color: var(--sf-color-danger-strong); border: 1px solid var(--sf-color-danger-muted)">Danger</div>
       </div>
🤖 Prompt for 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.

In `@docs/test-coverage-1-colors.html` around lines 237 - 246, The demo-swatch row
contains duplicate danger status entries on lines 237 and 239, reducing coverage
variety. Replace one of the duplicate danger demo-swatch divs with a different
status color variable (such as success, warning, or info) that is not already
represented in that row to maintain consistent status coverage across all demo
sections. Ensure the replacement div maintains the same structure as the other
demo-swatch elements with the appropriate CSS custom property for the chosen
status.
🧹 Nitpick comments (1)
configurator/src/components/Preview.svelte (1)

1235-1235: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Remove duplicate .pv__surface-danger selector to prevent drift.

Line 1235 defines .pv__surface-danger, but the same selector is defined again at Line 1237 with identical declarations. Keep a single source of truth.

Suggested cleanup
   .pv__surface-warning   { background: var(--sf-color-warning-subtle,   rgba(202,138,4,.1));   color: var(--sf-color-warning-strong,`#854d0e`); }
   .pv__surface-danger     { background: var(--sf-color-danger-subtle,    rgba(220,38,38,.1));   color: var(--sf-color-danger,`#dc2626`); }
   .pv__surface-info      { background: var(--sf-color-info-subtle,      rgba(8,145,178,.1));   color: var(--sf-color-info,`#0891b2`); }
-  .pv__surface-danger    { background: var(--sf-color-danger-subtle,    rgba(220,38,38,.1));   color: var(--sf-color-danger,`#dc2626`); }
🤖 Prompt for 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.

In `@configurator/src/components/Preview.svelte` at line 1235, The
`.pv__surface-danger` CSS selector is defined twice with identical declarations
in the stylesheet. Locate both definitions of the `.pv__surface-danger` selector
and remove one of the duplicate declarations, keeping only a single definition
to maintain a single source of truth and prevent unnecessary CSS drift.
🤖 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 `@configurator/src/data/api-index.generated.json`:
- Around line 3398-3406: The `--sf-color-heading` token's note claims it has
"slightly stronger contrast than body text for visual hierarchy," but the
current value formula is identical to `--sf-color-text`, making the semantic
contract misleading. Either adjust the oklch() formula values in both the
light-dark branches (the clamp constraints or the arithmetic operations on l, c,
h values) to make the heading color produce noticeably stronger contrast
compared to body text, or update the note to accurately reflect that they are
semantically equivalent. Check all other occurrences of this token around line
numbers 6910-6918 to apply the same fix consistently across the file.
- Around line 1467-1470: The group label "DARK SOURCE TOKENS (-dark,
animatable)" in the api-index.generated.json file is outdated and exposes the
deprecated suffix. Since this is a generated artifact, do not edit it directly.
Instead, locate the source metadata configuration that generates this file,
update all occurrences of the group label to reflect the new naming convention
and remove the reference to the old (-dark, animatable) suffix, then regenerate
the api-index.generated.json file to ensure all affected entries (including
those at the line ranges specified in the comment) are updated consistently.

---

Outside diff comments:
In `@docs/test-coverage-1-colors.html`:
- Around line 237-246: The demo-swatch row contains duplicate danger status
entries on lines 237 and 239, reducing coverage variety. Replace one of the
duplicate danger demo-swatch divs with a different status color variable (such
as success, warning, or info) that is not already represented in that row to
maintain consistent status coverage across all demo sections. Ensure the
replacement div maintains the same structure as the other demo-swatch elements
with the appropriate CSS custom property for the chosen status.

---

Nitpick comments:
In `@configurator/src/components/Preview.svelte`:
- Line 1235: The `.pv__surface-danger` CSS selector is defined twice with
identical declarations in the stylesheet. Locate both definitions of the
`.pv__surface-danger` selector and remove one of the duplicate declarations,
keeping only a single definition to maintain a single source of truth and
prevent unnecessary CSS drift.
🪄 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: fc1e3a7d-9fc5-4c21-8822-4f9e95a8e6fa

📥 Commits

Reviewing files that changed from the base of the PR and between 88a7817 and 5dfbc6c.

⛔ Files ignored due to path filters (2)
  • dist/badge-essential.json is excluded by !**/dist/**
  • dist/badge-optimal.json is excluded by !**/dist/**
📒 Files selected for processing (56)
  • README.md
  • configurator/src/components/BrandColorRow.svelte
  • configurator/src/components/DomainPanel.svelte
  • configurator/src/components/Preview.svelte
  • configurator/src/data/api-index.generated.json
  • configurator/src/data/token-registry.generated.json
  • configurator/src/lib/brandColors.js
  • configurator/src/lib/themes.js
  • configurator/src/styles/app.css
  • configurator/tests-e2e/import-export.spec.js
  • configurator/tests-e2e/preview.spec.js
  • configurator/tests/smoke.test.js
  • configurator/tests/store-history.test.js
  • configurator/tests/themes.test.js
  • core/layout.css
  • core/macros.css
  • core/motion.css
  • core/states.css
  • core/themes.css
  • core/tokens.css
  • docs/api-index.json
  • docs/api-index.md
  • docs/architecture.md
  • docs/classes.md
  • docs/demo.html
  • docs/llm-guide.md
  • docs/migration.md
  • docs/registry.json
  • docs/test-coverage-1-colors.html
  • docs/test-coverage-2-typography.html
  • docs/test-coverage-3-layout.html
  • docs/test-coverage-4-macros-states.html
  • docs/test-coverage-5-forms-features.html
  • docs/test-coverage-6-token-reference.html
  • docs/theming.md
  • docs/token-annotations.json
  • docs/token-index.json
  • docs/token-index.md
  • docs/tokens.md
  • optional/components.css
  • optional/config-example.css
  • optional/forms.css
  • optional/theme-example.css
  • optional/tokens.palette.css
  • scripts/check-token-registry.js
  • tests/auto-color.spec.js
  • tests/baseline-modern.json
  • tests/color-semantic.spec.js
  • tests/demo-a11y-panel.spec.js
  • tests/demo-visual.spec.js
  • tests/link-contrast.spec.js
  • tests/tier1-p7-oldengine.test.js
  • tests/tier1-p8-modern.spec.js
  • tests/token-api.snapshot.json
  • tests/tokens.spec.js
  • token-registry.json
💤 Files with no reviewable changes (1)
  • tests/baseline-modern.json
✅ Files skipped from review due to trivial changes (12)
  • tests/tokens.spec.js
  • tests/demo-a11y-panel.spec.js
  • tests/tier1-p7-oldengine.test.js
  • docs/classes.md
  • README.md
  • docs/architecture.md
  • optional/tokens.palette.css
  • configurator/tests/smoke.test.js
  • configurator/tests/store-history.test.js
  • docs/theming.md
  • tests/token-api.snapshot.json
  • docs/api-index.json
🚧 Files skipped from review as they are similar to previous changes (34)
  • configurator/tests-e2e/preview.spec.js
  • tests/tier1-p8-modern.spec.js
  • core/motion.css
  • configurator/src/lib/themes.js
  • configurator/src/components/DomainPanel.svelte
  • configurator/src/components/BrandColorRow.svelte
  • optional/config-example.css
  • core/layout.css
  • optional/components.css
  • tests/demo-visual.spec.js
  • tests/auto-color.spec.js
  • configurator/src/styles/app.css
  • tests/link-contrast.spec.js
  • core/states.css
  • optional/forms.css
  • docs/test-coverage-6-token-reference.html
  • scripts/check-token-registry.js
  • configurator/src/lib/brandColors.js
  • configurator/tests/themes.test.js
  • configurator/tests-e2e/import-export.spec.js
  • core/macros.css
  • tests/color-semantic.spec.js
  • optional/theme-example.css
  • docs/token-index.md
  • token-registry.json
  • configurator/src/data/token-registry.generated.json
  • docs/migration.md
  • docs/llm-guide.md
  • docs/tokens.md
  • docs/api-index.md
  • docs/token-annotations.json
  • core/themes.css
  • core/tokens.css
  • docs/token-index.json

Comment on lines 1467 to +1470
"group": "DARK SOURCE TOKENS (-dark, animatable)",
"description": "OKLCH dark source tokens for brand and status colors. Registered as typed <color> so scoped [data-theme=\"dark\"] sections inherit correct absolute values rather than an unresolved var() text string.",
"note": "Primary interactive color. Applied to filled buttons, active indicators, and brand accent surfaces.",
"value": "light-dark(var(--sf-color-action-light), var(--sf-color-action-dark, oklch(from var(--sf-color-action-light) clamp(0.65, calc(0.95 - l * 0.5), 0.88) calc(c * 0.9) h)))",
"value": "light-dark(var(--sf-color-action-source-light), var(--sf-color-action-source-dark, oklch(from var(--sf-color-action-source-light) clamp(0.65, calc(0.95 - l * 0.5), 0.88) calc(c * 0.9) h)))",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Update the source-dark group label to the new suffix.

These generated metadata rows still expose (-dark, animatable) even though the public token names were renamed to *-source-dark; this can leak the deprecated suffix into configurator grouping/search. Fix the source metadata and regenerate rather than hand-editing this artifact.

Proposed metadata wording
-      "group": "DARK SOURCE TOKENS (-dark, animatable)",
+      "group": "DARK SOURCE TOKENS (-source-dark, animatable)",

Also applies to: 1998-2005, 2171-2174, 2702-2709, 3235-3238, 3278-3285, 3427-3430, 3470-3476, 3811-3814, 4342-4349, 4539-4542, 5070-5077, 5291-5294, 5822-5829, 6043-6046, 6086-6093, 6211-6214, 6742-6749, 7323-7326, 7366-7373

🤖 Prompt for 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.

In `@configurator/src/data/api-index.generated.json` around lines 1467 - 1470, The
group label "DARK SOURCE TOKENS (-dark, animatable)" in the
api-index.generated.json file is outdated and exposes the deprecated suffix.
Since this is a generated artifact, do not edit it directly. Instead, locate the
source metadata configuration that generates this file, update all occurrences
of the group label to reflect the new naming convention and remove the reference
to the old (-dark, animatable) suffix, then regenerate the
api-index.generated.json file to ensure all affected entries (including those at
the line ranges specified in the comment) are updated consistently.

Comment on lines +3398 to +3406
"name": "--sf-color-heading",
"tier": "PUBLIC",
"role": "consumption",
"namespace": "color",
"category": "Core tokens",
"group": "DARK SOURCE TOKENS (-dark, animatable)",
"description": "OKLCH dark source tokens for brand and status colors. Registered as typed <color> so scoped [data-theme=\"dark\"] sections inherit correct absolute values rather than an unresolved var() text string.",
"note": "Form validation error color. Typically same hue as danger but can be tuned independently.",
"value": "light-dark(var(--sf-color-error-light), var(--sf-color-error-dark, oklch(from var(--sf-color-error-light) clamp(0.65, calc(0.95 - l * 0.5), 0.88) calc(c * 0.9) h)))",
"group": "Text",
"description": "Semantic text colors for every content role. All tokens adapt to light and dark mode automatically.",
"note": "Heading text color. Slightly stronger contrast than body text for visual hierarchy.",
"value": "light-dark( oklch(from var(--sf-color-neutral-source-light) clamp(0.05, calc(l - 0.4 - var(--sf-contrast-bias)), 0.35) c h), oklch(from var(--sf-color-neutral) clamp(0.70, calc(l + 0.25 + var(--sf-contrast-bias)), 1) c h) )",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Align --sf-color-heading with its stated contrast semantics.

--sf-color-heading currently computes the exact same value as --sf-color-text, but its note promises “slightly stronger contrast.” Either adjust the heading formula or update the note/aliasing to make the semantic contract explicit.

Also applies to: 6910-6918

🤖 Prompt for 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.

In `@configurator/src/data/api-index.generated.json` around lines 3398 - 3406, The
`--sf-color-heading` token's note claims it has "slightly stronger contrast than
body text for visual hierarchy," but the current value formula is identical to
`--sf-color-text`, making the semantic contract misleading. Either adjust the
oklch() formula values in both the light-dark branches (the clamp constraints or
the arithmetic operations on l, c, h values) to make the heading color produce
noticeably stronger contrast compared to body text, or update the note to
accurately reflect that they are semantically equivalent. Check all other
occurrences of this token around line numbers 6910-6918 to apply the same fix
consistently across the file.

claude added 2 commits June 24, 2026 04:35
After the dark branch of --sf-color-selection-bg was corrected to use
--sf-color-action-source-dark (instead of -source-light), the resolved
value changes from oklch(0.5 0.22 235) to its auto-derived dark
equivalent oklch(0.7 0.198 235). Update both the light-section
light-dark() expression and the dark-section resolved entry.
The [data-theme="dark"] override for --sf-color-selection-bg was still
referencing --sf-color-action-source-light. This override takes precedence
over the light-dark() fix in tokens.css, so dark-mode selection highlights
were drawing from the light source (oklch 0.5 0.22 235) instead of the
darker auto-derived source (oklch 0.7 0.198 235). Update to -source-dark
for semantic correctness and to match the P8 baseline.
@jackgranatowski
jackgranatowski merged commit c55ace2 into main Jun 24, 2026
13 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