-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update express checkout max button height to 55px #9117
Update express checkout max button height to 55px #9117
Conversation
Test the buildOption 1. Jetpack Beta
Option 2. Jurassic Ninja - available for logged-in A12s🚀 Launch a JN site with this branch 🚀 ℹ️ Install this Tampermonkey script to get more options. Build info:
Note: the build is updated when a new commit is pushed to this PR. |
Size Change: +1 B (0%) Total Size: 1.28 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The buttons render at the correct height according to the devtools (see issue below) on the customer-facing pages, but the WooPay button is still 56px
in the settings preview for me 🤔
I also see the ECE preview has it's min-height set to 56px:
I was able to fix the ECE preview min-height by changing the buttonSizeToPxMap
:
woocommerce-payments/client/settings/express-checkout-settings/payment-request-button-preview.js
Lines 29 to 33 in 53dc3a3
const buttonSizeToPxMap = { | |
small: 40, | |
medium: 48, | |
large: 56, | |
}; |
I was able to fix the WooPay button by modifying the stylesheet for the button:
height: 56px; |
For some reason the WooPay button at 55px is smaller than the Google Pay ECE button at 55px???
Both are 55px according to the dev tools. Maybe the ECE buttons don't take the border into account so a 1px
border means the end result is a height of 57px
? That seems to be right:
Setting the max-height
of the container to 55px
results in an obvious cut-off:
It's only just barely noticable when they're side-by-side so I think we can get away with fixing this in a separate PR once all the correct changes have been made here. Or maybe this warrants a bug report to Stripe?
Great catch! Sorry I missed those preview changes, but was a quick fix like you suggested.
I would lean that way of a separate PR, but only because it seems like this only applies to Light / Outline mode. I was wondering if you could confirm that as well? And if we don't involve changes to Stripe, our fix would be the set WooPay button to 57px essentially? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! 🚀
I would lean that way of a separate PR, but only because it seems like this only applies to Light / Outline mode. I was wondering if you could confirm that as well?
Ah yes, nice catch! Yes, this seems to be limited to Light/Outline mode. I wonder if it's related to the approach Stripe needed to take for margins 🤔 #9005 (comment)
And if we don't involve changes to Stripe, our fix would be the set WooPay button to 57px essentially?
I think so? That, at least, seems to be the only way to make them match for the light and outline versions 🤔
Having to make that distinction is what held me back from addressing here. I created this issue to track it going forward. |
Fixes #9006
Changes proposed in this Pull Request
This is a small update to set the maximum button height to 55px for WooPay, Google Pay, and Apple Pay. This was the result of this discussion in which it was observed the Stripe Express Checkout Element (ECE) has a max height of 55px. In the linked issue it was determined we should match Stripe's setting here of 55px. This PR makes the adjustment so that all buttons under our control will share this max height for consistency.
Testing instructions
npm run wp option set _wcpay_feature_stripe_ece 1
Large (55 px)
Large (55 px)
. Inspect all buttons displayed and confirm they are rendering at 55px height.wcpayConfig.woopayButton.height
andwcpayExpressCheckoutParams.button.height
are both55
. (Depending on some optionswcpayConfig
may need to bewcpay_upe_config
).npm run wp option set _wcpay_feature_stripe_ece 0
wcpayPaymentRequestParams.button.height
in this case.npm run changelog
to add a changelog file, choosepatch
to leave it empty if the change is not significant. You can add multiple changelog files in one PR by running this command a few times.Post merge