Skip to content

Commit

Permalink
Improve BNPL PMME and icon placement in shortcode checkout
Browse files Browse the repository at this point in the history
  • Loading branch information
gpressutto5 committed Dec 18, 2024
1 parent 18ce08a commit 2d3abdb
Showing 1 changed file with 49 additions and 17 deletions.
66 changes: 49 additions & 17 deletions client/checkout/classic/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,54 +46,54 @@
}

// Payment methods with PMME styles.
li.wc_payment_method:has( label .stripe-pmme-container ) {
li.wc_payment_method:has( label .stripe-pmme-container ) {
display: grid;
grid-template-columns: max-content 1fr;
grid-template-areas: 'li-input li-label'; // List Item grid.
align-items: baseline;

.input-radio {
grid-row: 1;
grid-column: 1;
//background-color: green !important;
grid-area: li-input;
}

> label {
display: grid !important;
grid-template-columns: auto 1fr;
grid-area: li-label;

grid-column: 2;
grid-row: 1;
//background-color: blue !important;
display: grid !important;
grid-template-columns: max-content 1fr;
grid-template-areas: 'label-spacer label-inner'; // Label grid.

> span.spacer {
//background-color: yellow !important;
grid-area: label-spacer;
}

> .woopayments-inner-label {
grid-area: label-inner;
display: grid;
grid-template-columns: 1fr max-content;
grid-template-areas:
'inner-text inner-logo'
'inner-pmme inner-logo'; // Inner label grid.
align-items: center;

> img {
grid-column: 2;
grid-row: 1 / span 2;
grid-area: inner-logo;
justify-self: right;
//background-color: red !important;
}

> .stripe-pmme-container {
width: 100%;
grid-column: 1;
grid-row-start: 2;
grid-area: inner-pmme;
pointer-events: none;
//background-color: fuchsia !important;
}
}
}
}

// Hide the PMMe container when the payment method is checked.
li.wc_payment_method:has( .input-radio:checked + label .stripe-pmme-container ) {
li.wc_payment_method:has( .input-radio:checked
+ label
.stripe-pmme-container ) {
.input-radio:checked {
+ label {
.stripe-pmme-container {
Expand All @@ -102,3 +102,35 @@ li.wc_payment_method:has( .input-radio:checked + label .stripe-pmme-container )
}
}
}

// Storefront compatibility.
.theme-storefront {
#payment {
.payment_methods {
> li.wc_payment_method {
// Storefront does not render the input radio button.
grid-template-areas: 'li-label'; // List Item grid for Storefront.
grid-template-columns: 1fr;

> input + label {
// Storefront uses a label::before for the radio button so we need to adjust the grid.
grid-template-areas: 'label-before label-spacer label-inner'; // Label grid for Storefront.
grid-template-columns: max-content max-content 1fr;
}

> input + label {
&::before {
grid-area: label-before;
}
}
}

// This makes sure labels that don't have the pmme container are displayed correctly.
li[class*='payment_method_woocommerce_payments'] {
> input + label {
display: block;
}
}
}
}
}

0 comments on commit 2d3abdb

Please sign in to comment.