Skip to content

Derive and inject scale-based tokens for radius / border / motion in preview and saved overrides - #109

Merged
jackgranatowski merged 5 commits into
mainfrom
codex/sprawdz-obsuge-ustawien-borders-w-panelach
Jun 30, 2026
Merged

Derive and inject scale-based tokens for radius / border / motion in preview and saved overrides#109
jackgranatowski merged 5 commits into
mainfrom
codex/sprawdz-obsuge-ustawien-borders-w-panelach

Conversation

@jackgranatowski

@jackgranatowski jackgranatowski commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Motivation

  • Users reported that the configurator only reacted to per-step "Fine‑tune radius steps" while the global Radius scale knob had no visible effect in the live preview or emitted CSS, indicating the high‑level scale knobs were not being expanded into concrete output tokens in all places where --sf-text-* and --sf-space-* were already handled.
  • The goal is to make scale knobs (radius, border, motion) behave like typography/spacing: compute concrete output tokens from a single scale and ensure those derived tokens are present both in the live preview and in the CSS emitted to WordPress.
  • Changes must be mirrored in the SPA preview injection, the preview iframe, and the PHP CSS generator so saved overrides and live previews are consistent.

Description

  • Added computeDerivedOverrides(ov) to admin-app/src/lib/persistence.ts which precomputes derived tokens for --sf-radius-*, --sf-border-width-*, and --sf-duration-* (in addition to text/space derived tokens) and exported it for reuse in the preview code.
  • Made the live preview injection include derived tokens by calling computeDerivedOverrides in injectLivePreview so :root style injected as sf-parent-overrides contains concrete output tokens that win over @layer declarations.
  • Updated admin-app/src/components/shell/PreviewPanel.svelte to apply withDerivedOverrides() (wrapping computeDerivedOverrides) when writing slashed-overrides into preview iframes so single‑iframe and split light/dark previews reflect scale knobs immediately.
  • Enhanced PHP emitter SLASHED-for-WP/includes/class-css-generator.php with compute_derived_overrides() and merged derived declarations before emitting saved override declarations so persisted frontend inline CSS contains concrete radius/border/motion tokens (while preserving user fine‑tune overrides precedence).
  • Rebuilt the admin bundle artifacts (assets/admin-app/app.js) so the SPA uses the new derived-token logic in the shipped preview.

Testing

  • Ran npm run check in admin-app (Svelte diagnostics) which completed with 0 errors and the existing warnings retained; the command succeeded.
  • Built the admin app with npm run build --ignore-scripts (Vite production build) and verified the bundle was produced; the build passed with existing warnings (chunk-size / a11y hints) and the generated assets/admin-app/app.js was updated.
  • Linted the PHP change with php -l includes/class-css-generator.php which reported no syntax errors.
  • Note: a full npm run build (including the prebuild fetch sync) failed in this environment because scripts/sync-core.mjs’s network fetch failed; the production build was validated by running Vite with --ignore-scripts as above.

Codex Task

Summary by CodeRabbit

  • New Features
    • Preview and live styling now automatically include additional derived design values from scale settings, including radius, border width, and motion timing (durations and animation delays), while still honoring explicit overrides.
  • Bug Fixes
    • Preview CSS generation and live preview output now stay more consistent with saved styling by using the expanded derived value set.
  • Accessibility / UI Polish
    • Improved focus behavior in dialogs/palettes and ensured color input edit focus reliably applies.
    • Glow toggle button now announces its state via an updated aria-label.

@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

Next review available in: 53 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

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

How do review limits work?

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

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, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: dd9f7c4e-0859-49f3-9977-b20f61d068e8

📥 Commits

Reviewing files that changed from the base of the PR and between a976f43 and 64e74ea.

📒 Files selected for processing (3)
  • SLASHED-for-WP/admin-app/src/AppOverlay.svelte
  • SLASHED-for-WP/assets/admin-app/app.js
  • SLASHED-for-WP/includes/class-css-generator.php
📝 Walkthrough

Walkthrough

Adds derived override computation in TypeScript and PHP for radius, border width, and motion scales, then uses those derived values in preview CSS and saved CSS output. It also updates several admin-app components for non-reactive snapshots, input focus, draft state, and dialog/button attributes.

Changes

Derived Override Token Expansion

Layer / File(s) Summary
computeDerivedOverrides implementation (TypeScript)
SLASHED-for-WP/admin-app/src/lib/persistence.ts
Replaces the previous scale-token computation with computeDerivedOverrides, adds step tables and generation branches for radius, border width, and motion token categories, and updates numeric parsing and formatting helpers.
Live preview wiring (TypeScript)
SLASHED-for-WP/admin-app/src/lib/persistence.ts, SLASHED-for-WP/admin-app/src/components/shell/PreviewPanel.svelte
Updates live preview CSS generation to use computeDerivedOverrides, adds withDerivedOverrides, and applies it to both the single-pane and split-pane iframe injection effects in PreviewPanel.svelte.
compute_derived_overrides and CSS emission (PHP)
SLASHED-for-WP/includes/class-css-generator.php
Adds compute_derived_overrides(), num_or_default(), and fmt_num() in Slashed_CSS_Generator, and updates generate_flat_override_declarations() to merge derived tokens with stored overrides before validation and emission.

Snapshot, focus, and dialog attributes

Layer / File(s) Summary
Snapshots and deferred focus
SLASHED-for-WP/admin-app/src/App.svelte, SLASHED-for-WP/admin-app/src/AppOverlay.svelte, SLASHED-for-WP/admin-app/src/components/inputs/ColorInput.svelte, SLASHED-for-WP/admin-app/src/components/inputs/SliderRow.svelte
App.svelte and AppOverlay.svelte wrap initial snapshot capture in untrack, ColorInput.svelte switches editable-input focus to a tick()-based effect, and SliderRow.svelte starts its draft state empty.
Dialog and button attributes
SLASHED-for-WP/admin-app/src/AppOverlay.svelte, SLASHED-for-WP/admin-app/src/components/CommandPalette.svelte, SLASHED-for-WP/admin-app/src/components/panels/ShadowsPanel.svelte
AppOverlay.svelte and CommandPalette.svelte add tabindex="-1" to dialog surfaces, and ShadowsPanel.svelte updates the Glow toggle button aria-label based on glowDisabled.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: deriving and injecting scale-based radius, border, and motion tokens into preview and saved overrides.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/sprawdz-obsuge-ustawien-borders-w-panelach

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.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Derive and inject scale-based tokens for radius/border/motion in preview + saved CSS

🐞 Bug fix ✨ Enhancement 🕐 20-40 Minutes

Grey Divider

AI Description

• Derive concrete radius/border/motion tokens from scale knobs, matching text/space behavior.
• Inject derived tokens into SPA and iframe previews so live preview reflects scale changes.
• Emit derived tokens in WP override CSS so saved overrides match preview output.
Diagram

graph TD
  A["Configurator UI"] --> B["Overrides map"] --> C["computeDerivedOverrides()"] --> D["Preview CSS (<style>)"] --> E["Preview iframe"]
  B --> F["WP CSS generator (PHP)"] --> G["Inline CSS output"]
  C --> F
  subgraph Legend
    direction LR
    _ui["UI"] ~~~ _fn["Derivation fn"] ~~~ _php["PHP emitter"]
  end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Derive tokens only at persistence time (save-time normalization)
  • ➕ Single source of truth for persisted output
  • ➕ Avoids repeated derivation during preview updates
  • ➖ Doesn't fix live preview unless preview uses saved output path
  • ➖ Harder to keep split-iframe and parent preview perfectly in sync
2. Encode derivation in CSS via calc() fallbacks (no explicit derived tokens)
  • ➕ Avoids generating many concrete tokens
  • ➕ Keeps behavior purely declarative in CSS
  • ➖ Requires rewriting token consumers to reference scale knobs (widespread changes)
  • ➖ Can be brittle across layering/precedence and older saved concrete values
3. Share a single derivation spec between TS and PHP (generated tables)
  • ➕ Prevents drift between frontend and backend step tables
  • ➕ Easier long-term maintenance as more scales are added
  • ➖ Adds build tooling / codegen complexity
  • ➖ Not necessary to resolve the immediate preview/emission inconsistency

Recommendation: The PR’s approach (derive in both preview injection paths and in the PHP emitter, while merging derived-before-explicit to preserve fine-tune precedence) is the most pragmatic fix for consistency across live preview and saved CSS. If drift between TS/PHP step tables becomes a recurring issue, consider introducing a shared spec or codegen as a follow-up.

Files changed (4) +180 / -69

Enhancement (1) +46 / -3
persistence.tsExport derivation for radius/border/motion scale knobs and use in live preview +46/-3

Export derivation for radius/border/motion scale knobs and use in live preview

• Renames/exports the derivation function as computeDerivedOverrides() and expands it to derive --sf-radius-*, --sf-border-width-*, and --sf-duration-* tokens (plus related motion tokens). Updates injectLivePreview() to merge derived tokens before explicit overrides so unlayered injected CSS wins correctly.

SLASHED-for-WP/admin-app/src/lib/persistence.ts

Bug fix (2) +71 / -3
PreviewPanel.svelteApply derived overrides when writing iframe preview CSS +9/-2

Apply derived overrides when writing iframe preview CSS

• Imports the shared derivation helper and wraps iframe override injection with a withDerivedOverrides() merge. Ensures both the single preview and split light/dark preview immediately reflect radius/border/motion scale knobs.

SLASHED-for-WP/admin-app/src/components/shell/PreviewPanel.svelte

class-css-generator.phpDerive and merge scale tokens before emitting saved override declarations +62/-1

Derive and merge scale tokens before emitting saved override declarations

• Adds compute_derived_overrides() to expand radius/border/motion scale knobs into concrete token declarations. Merges derived declarations before stored overrides so user fine-tune values continue to take precedence in emitted frontend inline CSS.

SLASHED-for-WP/includes/class-css-generator.php

Other (1) +63 / -63
app.jsRebuild admin bundle to include derived-token preview logic +63/-63

Rebuild admin bundle to include derived-token preview logic

• Updates the compiled admin SPA artifact so shipped preview behavior includes the new derived override computation.

SLASHED-for-WP/assets/admin-app/app.js

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

🧹 Nitpick comments (2)
SLASHED-for-WP/admin-app/src/components/shell/PreviewPanel.svelte (1)

26-29: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

withDerivedOverrides duplicates the merge already in injectLivePreview.

This helper repeats the exact merge logic from injectLivePreview (persistence.ts Line 220). Consider exporting a single withDerivedOverrides from persistence.ts and importing it here so the merge precedence stays defined in one place.

🤖 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 `@SLASHED-for-WP/admin-app/src/components/shell/PreviewPanel.svelte` around
lines 26 - 29, The merge logic in withDerivedOverrides duplicates the same
override precedence already implemented in injectLivePreview, so keep the
behavior in one place. Move or export a single withDerivedOverrides helper from
persistence.ts and reuse it in PreviewPanel.svelte, ensuring injectLivePreview
and PreviewPanel both call the shared symbol so derived values continue to be
overridden by explicit values consistently.
SLASHED-for-WP/admin-app/src/lib/persistence.ts (1)

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

Keep the TS and PHP derived-token tables in sync. computeDerivedOverrides and Slashed_CSS_Generator::compute_derived_overrides duplicate the same radius/border/motion tables and special-case tokens; add a small parity check and cross-links so preview CSS and persisted CSS can’t drift.

🤖 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 `@SLASHED-for-WP/admin-app/src/lib/persistence.ts` around lines 92 - 162, Keep
the derived-token logic in `computeDerivedOverrides` aligned with
`Slashed_CSS_Generator::compute_derived_overrides` by adding a small parity
check over the shared radius, border, and motion token tables plus the
special-case tokens like `--sf-radius-none`, `--sf-radius-full`,
`--sf-radius-pill`, `--sf-radius-outer`, and the motion duration/delay entries.
Wire the check into the existing TS persistence path so any table drift is
detected early, and add cross-links or shared constants where possible so both
preview CSS and persisted CSS are generated from the same source of truth. Use
the unique symbols in this module and the PHP generator to locate the duplicated
mappings and keep them synchronized.
🤖 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.

Nitpick comments:
In `@SLASHED-for-WP/admin-app/src/components/shell/PreviewPanel.svelte`:
- Around line 26-29: The merge logic in withDerivedOverrides duplicates the same
override precedence already implemented in injectLivePreview, so keep the
behavior in one place. Move or export a single withDerivedOverrides helper from
persistence.ts and reuse it in PreviewPanel.svelte, ensuring injectLivePreview
and PreviewPanel both call the shared symbol so derived values continue to be
overridden by explicit values consistently.

In `@SLASHED-for-WP/admin-app/src/lib/persistence.ts`:
- Around line 92-162: Keep the derived-token logic in `computeDerivedOverrides`
aligned with `Slashed_CSS_Generator::compute_derived_overrides` by adding a
small parity check over the shared radius, border, and motion token tables plus
the special-case tokens like `--sf-radius-none`, `--sf-radius-full`,
`--sf-radius-pill`, `--sf-radius-outer`, and the motion duration/delay entries.
Wire the check into the existing TS persistence path so any table drift is
detected early, and add cross-links or shared constants where possible so both
preview CSS and persisted CSS are generated from the same source of truth. Use
the unique symbols in this module and the PHP generator to locate the duplicated
mappings and keep them synchronized.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 43b2bae8-9e1d-4864-b985-3553abf784a4

📥 Commits

Reviewing files that changed from the base of the PR and between 8fd931f and 1d892f4.

📒 Files selected for processing (4)
  • SLASHED-for-WP/admin-app/src/components/shell/PreviewPanel.svelte
  • SLASHED-for-WP/admin-app/src/lib/persistence.ts
  • SLASHED-for-WP/assets/admin-app/app.js
  • SLASHED-for-WP/includes/class-css-generator.php

@qodo-code-review

qodo-code-review Bot commented Jun 30, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Non-numeric scales default to 1 ✓ Resolved 🐞 Bug ☼ Reliability
Description
Derived overrides are computed whenever a scale key exists, but non-numeric scale values (e.g.
var()/calc()) are treated as scale=1 while still emitting derived tokens, overriding the framework’s
runtime scale formulas. In JS, non-finite values like "Infinity" can also crash preview injection
due to fmt() calling toFixed() on a non-finite number.
Code

SLASHED-for-WP/admin-app/src/lib/persistence.ts[R151-160]

+  if (hasMotion) {
+    const scale = getNum(ov, '--sf-motion-scale', 1);
+    for (const [name, base] of DURATION_STEPS) {
+      derived[`--sf-duration-${name}`] = `${fmt(base * scale)}ms`;
+    }
+    derived['--sf-duration-none'] = '0ms';
+    derived['--sf-theme-transition-duration'] = `${fmt(300 * scale)}ms`;
+    for (let i = 1; i <= 5; i += 1) {
+      derived[`--sf-animation-delay-${i}`] = `${fmt(75 * i * scale)}ms`;
+    }
Relevance

⭐⭐⭐ High

Repo recently added raw CSS expression support; likely will fix non-numeric/non-finite scale
handling to avoid overriding formulas/crashes (PR94).

PR-#94

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
JS parses override strings with parseFloat and formats with toFixed without finite checks, so
non-numeric/non-finite scales become 1 or can crash. PHP value validation allows var()/calc()
expressions to be stored/emitted, but compute_derived_overrides treats them as non-numeric and still
emits fixed derived tokens, overriding the framework’s scale-based calc() definitions.

SLASHED-for-WP/admin-app/src/lib/persistence.ts[66-77]
SLASHED-for-WP/admin-app/src/lib/persistence.ts[92-163]
SLASHED-for-WP/admin-app/framework-css/core/tokens.css[1164-1172]
SLASHED-for-WP/admin-app/framework-css/core/tokens.css[1211-1220]
SLASHED-for-WP/admin-app/framework-css/core/tokens.css[1260-1265]
SLASHED-for-WP/includes/class-css-generator.php[89-105]
SLASHED-for-WP/includes/class-css-generator.php[119-158]
SLASHED-for-WP/includes/class-css-generator.php[333-355]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Both the SPA and PHP emit derived output tokens when `--sf-*-scale` exists in the overrides map. However:
- JS uses `parseFloat()` and falls back to `1` on `NaN`, still emitting derived tokens.
- PHP uses `is_numeric()` and falls back to `1`, still emitting derived tokens.

This breaks legitimate dynamic scale overrides like `--sf-motion-scale: var(--my-scale)` (which pass the PHP emitter’s value validation) because the derived tokens override the framework’s `calc(... * var(--sf-*-scale))` definitions.

Additionally, in JS `fmt()` calls `n.toFixed(6)` with no `Number.isFinite` guard, which can throw on non-finite values and break live preview.

## Issue Context
The framework tokens are already expressed in terms of the scale variables (e.g., `--sf-duration-fast: calc(150ms * var(--sf-motion-scale))`). Derived overrides should not silently replace that behavior with scale=1.

## Fix Focus Areas
- SLASHED-for-WP/admin-app/src/lib/persistence.ts[66-77]
- SLASHED-for-WP/admin-app/src/lib/persistence.ts[133-162]
- SLASHED-for-WP/includes/class-css-generator.php[89-105]
- SLASHED-for-WP/includes/class-css-generator.php[119-158]

## Suggested fix
Choose one of these approaches (either is acceptable; (A) is more robust):

(A) Support expression scales without parsing:
- If a scale override is not a plain finite number literal, emit derived tokens using the same expression form as the framework but unlayered, e.g.:
 - `--sf-radius-m: calc(8px * var(--sf-radius-scale))`
 - `--sf-border-width-2: calc(2px * var(--sf-border-scale, 1))`
 - `--sf-duration-fast: calc(150ms * var(--sf-motion-scale))`
This preserves dynamic behavior and still achieves the “unlayered override wins” goal.

(B) Only derive when scale is a finite number:
- Add strict checks:
 - JS: use a numeric-literal regex + `Number.isFinite(...)` before computing; otherwise return `{}` for that scale family.
 - PHP: only derive when `is_numeric($value)` and `is_finite((float)$value)`; otherwise skip deriving.
- In JS, harden `getNum()` / `fmt()` to treat non-finite numbers as default values (avoid throwing in `toFixed`).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Radius aliases flattened incorrectly ✓ Resolved 🐞 Bug ≡ Correctness
Description
computeDerivedOverrides() hard-codes --sf-radius-pill and --sf-radius-outer as scale-based concrete
values, but the framework defines pill as an alias of --sf-radius-full and outer in terms of
--sf-radius-m. This breaks propagation in the generated override CSS (preview + emitted CSS):
overriding --sf-radius-full or fine-tuning --sf-radius-m will no longer update pill/outer unless
those tokens are also overridden explicitly.
Code

SLASHED-for-WP/admin-app/src/lib/persistence.ts[R139-142]

+    derived['--sf-radius-full'] = '9999px';
+    derived['--sf-radius-pill'] = '9999px';
+    derived['--sf-radius-outer'] = `calc(${fmt(8 * scale)}px + var(--sf-component-pad))`;
+  }
Relevance

⭐⭐ Medium

No prior review precedent on alias tokens; team cares about token propagation/avoiding shadowing
(PR94).

PR-#94

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The PR-derived radius declarations hard-code pill/outer, but the framework defines them as dependent
tokens (pill aliases full; outer references radius-m). Flattening them in derived overrides prevents
--sf-radius-full / --sf-radius-m changes from flowing into pill/outer in the flattened emitted
CSS.

SLASHED-for-WP/admin-app/src/lib/persistence.ts[133-142]
SLASHED-for-WP/includes/class-css-generator.php[122-131]
SLASHED-for-WP/admin-app/framework-css/core/tokens.css[1211-1240]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Derived overrides flatten two radius tokens that the framework defines as dependent/aliased tokens:
- `--sf-radius-pill` should track `--sf-radius-full`.
- `--sf-radius-outer` should track `--sf-radius-m` (plus padding).

Flattening them to constants/scale math makes the generated override CSS diverge from the framework’s dependency graph, so fine-tunes to `--sf-radius-full` or `--sf-radius-m` won’t propagate to `pill/outer`.

## Issue Context
The framework token definitions are:
- `--sf-radius-pill: var(--sf-radius-full)`
- `--sf-radius-outer: calc(var(--sf-radius-m) + var(--sf-component-pad))`

But the PR’s derived overrides currently emit:
- `--sf-radius-pill: 9999px`
- `--sf-radius-outer: calc(8px * scale + var(--sf-component-pad))`

## Fix Focus Areas
- SLASHED-for-WP/admin-app/src/lib/persistence.ts[133-142]
- SLASHED-for-WP/includes/class-css-generator.php[122-131]

## Suggested fix
1. In both JS and PHP derived-token generators:
  - Set `--sf-radius-pill` to `var(--sf-radius-full)` (not a literal `9999px`).
  - Set `--sf-radius-outer` to `calc(var(--sf-radius-m) + var(--sf-component-pad))` (so any explicit `--sf-radius-m` override continues to influence outer).
2. Keep `--sf-radius-full` as a constant only if needed; otherwise you can omit it from derived output since it’s already a framework constant.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

Comment thread SLASHED-for-WP/admin-app/src/lib/persistence.ts
Comment thread SLASHED-for-WP/admin-app/src/lib/persistence.ts Outdated
jackgranatowski and others added 4 commits June 30, 2026 10:56
…atting

- --sf-radius-pill now emits var(--sf-radius-full) instead of 9999px,
  and --sf-radius-outer emits calc(var(--sf-radius-m) + var(--sf-component-pad))
  so fine-tuning --sf-radius-full or --sf-radius-m propagates correctly
- Skip derived-token emission in both TS and PHP when a scale value is
  non-numeric (e.g. var()/calc()), preventing silent override of framework
  runtime formulas; JS fmt() now guards against non-finite values
- Expand inline PHP associative arrays to multi-line and fix assignment
  alignment to satisfy WordPress coding standards (phpcs)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MhTeTwHB6FWbkRuGmSc1yU
Merged origin/main (PR #110) into the branch. The only conflict was the
generated app.js bundle; resolved by rebuilding from the merged source.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MhTeTwHB6FWbkRuGmSc1yU
- Delete num_or_default() helper that became unused after refactoring
  compute_derived_overrides() to use inline is_numeric() guards directly
- Fix equals-sign alignment for $scale/$r_steps assignment block to
  satisfy WordPress phpcs alignment sniff

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MhTeTwHB6FWbkRuGmSc1yU
@jackgranatowski
jackgranatowski merged commit 9e122f7 into main Jun 30, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants