Shadow engine v2: contact/key/ambient model, tinted shadows, perf fixes - #2
Merged
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ed against shared fixture
…or v2 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… web tab fallback - fixture now carries 4 tint cases (red/green/blue max, both hue2rgb wraparounds), asserted in a loop by both TS and Swift suites - animatable-CSS parity test asserts all 5 layers of base and elevated - node --test uses a recursive glob (plain directory arg breaks on Node 24) - CodePreview derives activeTab so the highlight survives the animatable tab disappearing in gradient mode Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the v1 5-divisor shadow engine with a unified, physically-motivated contact / key / ambient layer model across every target (SwiftUI, CSS, Figma, Framer), plus surface-tinted shadow colors and performance hardening. Public APIs are unchanged.
layers.ts, are mirrored verbatim inConstants.swift, and a shared JSON fixture is asserted by both the TS and Swift test suites so the ports can't drift.tintShadowColor(TS) /Color.happyShadowTint(Swift): keeps the surface hue, boosts saturation, drops lightness. Opt-in toggle + surface picker in the web app, Figma plugin, Framer plugin, and ShadowDesigner. Color is baked into generated code — zero runtime cost..compositingGroup()before both SwiftUI shadow stacks (blurs run on one rasterized silhouette instead of re-rendering the hierarchy 5×); newgenerateAnimatedCSS()emits a pseudo-element opacity-crossfade (withisolation: isolate) so elevation transitions never re-blur per frame.Design spec:
docs/superpowers/specs/2026-07-10-shadow-engine-v2-design.mdPlan:
docs/superpowers/plans/2026-07-10-shadow-engine-v2.mdTest plan
pnpm -C packages/shadow-core test) — fixture parity, all tint hue branches incl. both hue2rgb wraparounds, blur ordering, gradient expansion, animatable-CSS pattern (all 5 layers, base + elevated)swift test) — fixture parity for layers and tint, snapshot regeneration🤖 Generated with Claude Code