Skip to content

update logos/text showing#2629

Open
delbarrow wants to merge 2 commits intomainfrom
feature/paylater-credit-logo-swap
Open

update logos/text showing#2629
delbarrow wants to merge 2 commits intomainfrom
feature/paylater-credit-logo-swap

Conversation

@delbarrow
Copy link
Copy Markdown
Contributor

@delbarrow delbarrow commented Apr 24, 2026

Description

Summary
Adds PayPalRebrandLogo and label text to the rebrand paylater and credit button labels, mirroring the PayPal button label structure
toggleLogos determines at runtime whether the PayPal wordmark + text combo fits the button width, and swaps to the PP monogram when it does not

Why the text animation does not slide in (known open issue)
The show-text CSS animation in labels.js is:

.dom-ready .paypal-button .paypal-button-text:not(.immediate):not(.personalization-text):not(.hidden) {
    animation: show-text 1s 0s forwards;
}

This animation fires exactly once — when dom-ready is added to — on any text element that is currently visible (not .hidden). For the PayPal button labels, this works because the text starts CSS-hidden, toggleOptionals decides it fits and never adds .hidden, and then dom-ready fires and the animation plays cleanly.

For paylater/credit, toggleLogos is called inside setDomReady's setTimeout callback — which runs after dom-ready is added to the body.
toggleLogos calls hideElement(paypalLogo) and hideElement(ppLogo) to temporarily pull both logos out of flow for measurement. These calls set position: absolute on the logo elements, which collapses the flex container width. This reflow happens while the show-text animation is in progress, causing the browser to recalculate the text element's max-width percentage mid-animation and visually snap/flash instead of slide.

Additionally, the toggleOptionals call in this same setTimeout calls showElement(text) unconditionally — classList.remove("hidden") — even when .hidden was never present. Any classList mutation on the text element triggers a style recalculation that resets the running CSS animation.

The root tension: toggleLogos needs DOM layout to be complete to measure widths accurately (requiring the setTimeout), but by the time layout is complete, dom-ready has already been added and the animation has started. Any DOM mutation that causes a reflow at this point interrupts the animation.

Why are we making these changes? Include references to any related Jira tasks or GitHub Issues

Reproduction Steps (if applicable)

Screenshots (if applicable)

paylater.mov

Dependent Changes (if applicable)

Groups who should review (if applicable)

❤️ Thank you!

@delbarrow delbarrow marked this pull request as ready for review April 24, 2026 06:13
@delbarrow delbarrow requested a review from a team as a code owner April 24, 2026 06:13
@delbarrow delbarrow force-pushed the feature/paylater-credit-logo-swap branch from a952e19 to f9edf73 Compare April 24, 2026 14:02
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