Open
Conversation
a952e19 to
f9edf73
Compare
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.
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:
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!