Skip to content

fix(agent): make CSS edits replaceable and priority-aware#208

Merged
DavidBabinec merged 2 commits into
mainfrom
fix/agent-css-editing
Jul 11, 2026
Merged

fix(agent): make CSS edits replaceable and priority-aware#208
DavidBabinec merged 2 commits into
mainfrom
fix/agent-css-editing

Conversation

@DavidBabinec

@DavidBabinec DavidBabinec commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add explicit merge, replace, delete, and remove-properties operations to site_apply_css with exact-selector, atomic store semantics
  • preserve !important through CSS import, persistence, canvas preview, responsive sizing, and published output
  • expose background image/clip and WebKit text-mask computed styles in render snapshots so cascade resets are diagnosable
  • advertise a flat provider-compatible CSS tool schema while enforcing the exact operation union at the editor boundary

Why

A later background shorthand could reset an earlier background-clip: text, leaving transparent text over a solid gradient rectangle. The previous merge-only tool could not reliably remove or replace stale declarations, and CSS priority metadata was discarded.

Anthropic also requires tool inputs to be object-rooted with no root-level anyOf, oneOf, or allOf. The provider schema now follows that contract without weakening operation-specific validation in the editor.

User/developer impact

Agents can repair overlapping CSS without accumulating more rules, destructive edits are explicit and atomic, class identity and assignments survive replacement, and snapshots expose the computed evidence needed to debug gradient text. The same tool now works across Anthropic and the other supported providers.

Verification

  • bun test — 6,206 pass, 0 fail
  • focused post-rebase agent integration suite — 176 pass, 0 fail
  • bun run lint
  • bunx tsc --noEmit
  • bun run build
  • GitHub CI + CodeQL — 7 checks pass

@DavidBabinec
DavidBabinec force-pushed the fix/agent-css-editing branch from 86b72c3 to a6e7aab Compare July 11, 2026 15:02
@DavidBabinec
DavidBabinec marked this pull request as ready for review July 11, 2026 15:05
@DavidBabinec
DavidBabinec merged commit 4c8a426 into main Jul 11, 2026
9 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.

1 participant