Skip to content

Pass focus color and blended background to Stripe Link - #3582

Open
vivi-the-going-merry[bot] wants to merge 2 commits into
masterfrom
fix/issue-6864-stripe-link-colors
Open

vivi-the-going-merry[bot] wants to merge 2 commits into
masterfrom
fix/issue-6864-stripe-link-colors

Conversation

@vivi-the-going-merry

@vivi-the-going-merry vivi-the-going-merry Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Part of Strategy11/formidable-pro#6864 (items 2 and 3 only, Lite side).

What was broken

  • Stripe Link's "Send code to email instead", "Change" and kebab menu used Stripe's default blue, because loadStripeLinkElements() never set colorPrimary.
  • maybeAdjustColorForStripe() converted rgba to hex by dropping the alpha, so a transparent or translucent field background reached Stripe as solid #ffffff.

What changed

  • colorPrimary is now the style's active (focus) border color. get_appearance_rules() already builds a .Input:focus rule, so it now also carries borderColor, which makes Stripe's focus border match the form style too. Chosen over the submit button color because that would need a new lookup, and the focus color is the style's accent.
  • Stripe's Appearance API variables don't take rgba (the existing comment says so), so rgba colors are now blended over the first solid background behind the card element, falling back to white, instead of dropping the alpha. A partly transparent ancestor is skipped, so the result is approximate there.
  • frmstrp.min.js regenerated with the repo's npm run minimize command (unchanged source reproduces the committed min byte for byte).

Not in this PR

  • Item 1 (web fonts via fonts on stripe.elements()), item 4 (deferred intent, needs a design decision), and the matching formidable-stripe add-on change.

How it was verified

  • A node harness around the extracted maybeAdjustColorForStripe(): red first (translucent white over black returned #ffffff, fully transparent returned #ffffff), green after the change (#1a1a1a and the backdrop color). Opaque rgba and hex pass through unchanged.
  • PHPUnit assertion added to test_empty_style_context_has_all_appearance_keys for the new .Input:focus key. Not run locally. CI's PHPUnit job fails before any test runs (Could not read "phpunit9.xml", deleted on master in 6a6ad92, also fails on other PRs), so this assertion has not been run.
  • No live Stripe Link render and no before/after screenshot yet. The Link iframe needs a real publishable key and client secret.

🤖 Generated with Claude Code

Stripe Link used its default blue because no colorPrimary was set, and
a translucent field background became a solid color when its alpha was
dropped. Take colorPrimary from the style's active border color and
blend rgba colors over the solid background behind the field.

Part of Strategy11/formidable-pro#6864

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: Strategy11/formidable-forms/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7d65e0ca-d072-4253-8068-c3e8eac07fb3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@deepsource-io

deepsource-io Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in 40f899d...3119ee1 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
PHP Oct 17, 2026 3:42p.m. Review ↗
JavaScript Oct 17, 2026 3:42p.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

$this->assertArrayHasKey( '.Input', $rules );
$this->assertArrayNotHasKey( 'fontFamily', $rules['.Input'] );
$this->assertArrayNotHasKey( 'fontFamily', $rules['.Label'] );
$this->assertArrayHasKey( 'borderColor', $rules['.Input:focus'] );

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Call to an undefined method test_FrmStrpLiteMergedUpdates::assertArrayHasKey()


The method you are trying to call is not defined, which can result in a fatal error.

…ripe

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@vivi-the-going-merry vivi-the-going-merry Bot added vivi-working Vivi is actively working this run tests and removed vivi-pickup labels Oct 19, 2026
@vivi-the-going-merry

Copy link
Copy Markdown
Contributor Author

@Crabcyborg I can't finish this one without a decision from you.

  • Blocked: a before/after screenshot of Stripe Link. The Link controls only show up with a real Stripe key, and I don't have one. I did not send this to Franky, because a screenshot is required for style changes.
  • PHPUnit: I added run tests. The job fails before any test runs: Could not read "phpunit9.xml". Commit 6a6ad92 deleted that file on master, but phpunit.yml still uses it. Other PRs fail the same way, so I left it alone.
  • DeepSource: the assertArrayHasKey warning is a false positive. The same file already calls it three times.
  • Analysis checks: all passed on this commit (3119ee1) on Oct 17.

Pick one and re-add vivi-pickup with a note:

  1. Send it to Franky without a Link screenshot.
  2. Give me a Stripe test publishable key path, and I'll capture one.

@vivi-the-going-merry vivi-the-going-merry Bot removed the vivi-working Vivi is actively working this label Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant