Skip to content
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

Adjust spacing in/between elements on the Cart and Checkout block pages #44160

Merged
merged 21 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
6e3ebff
Add spacing in Checkout block page
tarunvijwani Jan 29, 2024
dde3a5b
Add spacing in Order summary block
tarunvijwani Jan 29, 2024
443cf5b
Update responsive styles for order summary panel
tarunvijwani Jan 29, 2024
ae18953
Update styles for cart and cart line items table
tarunvijwani Jan 30, 2024
3baeba4
Update styles for order summary and cross-sells products
tarunvijwani Jan 31, 2024
6b47157
Remove unnecessary CSS styles from cart line items table and cart block
tarunvijwani Jan 31, 2024
c28d0cd
Remove unused CSS class from cart line items table
tarunvijwani Feb 1, 2024
7e854f0
Fix linting errors
tarunvijwani Feb 1, 2024
3465af0
Add changelog
tarunvijwani Feb 2, 2024
802cb39
Fix changelog lint
tarunvijwani Feb 2, 2024
80ed7ab
Update quantity selector style
tarunvijwani Feb 2, 2024
50c3228
Increase the line-height of the set description and remove margin top…
tarunvijwani Feb 7, 2024
4635f0e
Add margin-top to order summary image and express payment margin adju…
tarunvijwani Feb 15, 2024
c780693
Update styles for cart and checkout components
tarunvijwani Feb 15, 2024
dfafc18
Merge branch 'trunk' into update/42108-adjust-cart-checkout-spacing
tarunvijwani Feb 15, 2024
f615f25
Fix linting error
tarunvijwani Feb 15, 2024
8d5210d
Fix margin units in cart-cross-sells-products
tarunvijwani Feb 16, 2024
0886152
Replace em with px
tarunvijwani Feb 16, 2024
d9f973d
Add margin-top to payment method container
tarunvijwani Feb 16, 2024
0b1d3b3
Update styles for Cart block for mobile screen
tarunvijwani Feb 16, 2024
5017116
Update padding in cart style.scss
tarunvijwani Feb 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,24 @@ table.wc-block-cart-items {
}
}
.wc-block-cart-items__row {

.wc-block-cart-item__wrap > *,
.wc-block-components-quantity-selector {
margin-bottom: $gap-small;
}

.wc-block-cart-item__wrap > *:last-child {
margin-bottom: 0;
}

.wc-block-cart-item__image img {
width: 100%;
margin: 0;
}
.wc-block-cart-item__prices {
line-height: 1.2;
}

.wc-block-cart-item__quantity {
.wc-block-cart-item__remove-link {
@include link-button();
Expand All @@ -48,14 +62,12 @@ table.wc-block-cart-items {
.wc-block-components-product-name {
display: block;
max-width: max-content;
line-height: 1.4;
}
.wc-block-cart-item__total {
@include font-size( regular );
text-align: right;
line-height: inherit;
}
.wc-block-components-product-metadata {
margin-bottom: 0.75em;
line-height: 1.8;
}

&.is-disabled {
Expand All @@ -72,6 +84,7 @@ table.wc-block-cart-items {
table.wc-block-cart-items {
td {
padding: 0;
margin: 0;
}
.wc-block-cart-items__header {
display: none;
Expand Down Expand Up @@ -99,15 +112,15 @@ table.wc-block-cart-items {
grid-column-end: 4;
grid-row-start: 1;
justify-self: stretch;
padding: 0 $gap $gap 0;
padding: 0;
}
.wc-block-cart-item__quantity {
grid-column-start: 1;
grid-row-start: 2;
vertical-align: bottom;
padding-right: $gap;
align-self: end;
padding-top: $gap;
padding-top: 0;
}
.wc-block-cart-item__total {
grid-row-start: 1;
Expand All @@ -128,16 +141,16 @@ table.wc-block-cart-items {
border-bottom: 1px solid $universal-border-light;

th {
padding: 0.25rem $gap 0.25rem 0;
padding: $gap-smaller $gap $gap-smaller 0;
white-space: nowrap;
}
td {
border-top: 1px solid $universal-border-light;
padding: $gap 0 $gap $gap;
padding: $gap-large 0 $gap-large $gap;
vertical-align: top;
}
th:last-child {
padding-right: 0;
padding-right: $gap;
}
td:last-child {
padding-right: $gap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
}

.wc-block-components-order-summary-item {
border-bottom: 1px solid $universal-border-light;
@include font-size(small);
display: flex;
padding-bottom: 1px;
Expand Down Expand Up @@ -53,6 +52,7 @@
.wc-block-components-order-summary-item__image {
width: #{$gap-large * 2};
padding-bottom: $gap;
margin-top: 10px;
position: relative;

> img {
Expand Down Expand Up @@ -91,7 +91,7 @@
p,
.wc-block-components-product-metadata {
line-height: 1.375;
margin-top: #{ ($gap-large - $gap) * 0.5 };
margin-top: $gap-smaller;
}
}

Expand All @@ -100,9 +100,25 @@
margin-left: auto;
text-align: right;
}
.wc-block-components-totals-item__description.wc-block-components-totals-shipping__via {
padding-top: $gap-smallest;
}


.wc-block-components-order-summary-item__individual-prices {
display: block;
padding-top: $gap-smaller;
}

}

.is-medium,
.is-small,
.is-mobile {
.wp-block-woocommerce-checkout-order-summary-block {
.wc-block-components-totals-wrapper {
padding-left: $gap-small;
padding-right: $gap-small;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

.wc-block-components-sidebar {
box-sizing: border-box;
margin: 0;
margin-top: $gap-smaller;
padding-left: math.percentage(math.div($gap-large, 1060px));
width: 35%;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ $border-width: 1px;
align-items: center;
text-align: center;
padding: 0 $gap-large;
margin: $gap-large 0;
margin: $gap-larger 0 ( 3.5 * $grid-unit );

&::before {
margin-right: 10px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
.wc-block-gateway-container {
position: relative;
margin-bottom: em($gap-large);
margin-top: $gap-smaller;
white-space: nowrap;

&.wc-card-number-element {
Expand Down Expand Up @@ -188,8 +189,6 @@
.wc-block-components-radio-control__option:first-child,
.wc-block-components-radio-control__option:last-child {
margin: 0;
padding-bottom: em($gap);
padding-top: em($gap);
}

.wc-block-components-radio-control__option-checked {
Expand All @@ -211,6 +210,10 @@
.wc-block-components-radio-control__option {
border-width: 0;
}
.wc-block-components-radio-control-accordion-option {
padding-bottom: $gap;
padding-top: $gap;
}

.wc-block-components-radio-control-accordion-option:first-child::after {
border-top-left-radius: $universal-border-radius;
Expand Down Expand Up @@ -261,9 +264,8 @@
}

}

.wc-block-components-radio-control-accordion-content {
padding: 0 $gap em($gap) $gap;
padding: $gap-smaller $gap;

&:empty {
display: none;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@

.wp-block-woocommerce-cart-cross-sells-block {

.wp-block-heading {
margin-bottom: $gap-large;
}

.cross-sells-product {
display: inline-block;
box-sizing: content-box;
margin-bottom: 2em;
margin-bottom: $gap;
padding-right: 5%;
text-align: center;
vertical-align: top;
Expand All @@ -26,9 +30,16 @@
}

div {
.wc-block-components-product-image {
margin-bottom: $gap;
}

.wc-block-components-product-name {
font-weight: 400;
}
.wp-block-cart-cross-sells-product__product-title {
margin-bottom: $gap;
}

.wc-block-components-product-price {
display: block;
Expand Down
30 changes: 28 additions & 2 deletions plugins/woocommerce-blocks/assets/js/blocks/cart/style.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.wc-block-cart {
padding-top: $gap;

.wc-block-components-shipping-calculator {
white-space: nowrap;
}
Expand All @@ -21,7 +23,7 @@
table.wc-block-cart-items,
table.wc-block-cart-items th,
table.wc-block-cart-items td {
margin: 0 0 2em;
margin: 0 0 $gap * 2.5;
}
}

Expand Down Expand Up @@ -89,6 +91,10 @@
}
}

.wc-block-components-sidebar-layout.wc-block-cart {
padding-top: 0;
}

.is-small,
.is-mobile {
.wc-block-cart-item__total {
Expand All @@ -99,6 +105,9 @@
table.wc-block-cart-items {
margin: 0;
}
.wc-block-components-shipping-rates-control .wc-block-components-radio-control__option {
padding: 0 0 0 em($gap-huge);
}
}

.is-medium,
Expand Down Expand Up @@ -126,7 +135,7 @@
@include font-size( smaller );
display: block;
font-weight: 700;
padding: 0.25rem 0;
padding: $gap-smaller $gap $gap-smaller 0;
text-align: right;
text-transform: uppercase;

Expand All @@ -136,11 +145,28 @@
}

.wc-block-components-sidebar {
margin-top: 0;

.wc-block-components-shipping-calculator,
.wc-block-components-shipping-rates-control__package:not(.wc-block-components-panel) {
padding-left: $gap;
padding-right: $gap;
}

.wc-block-components-totals-item__description.wc-block-components-totals-shipping__via,
.wc-block-components-totals-shipping__change-address__link {
padding-top: $gap-smallest;
}

.wc-block-components-totals-shipping__options {
margin-top: $gap;
}
.wc-block-components-radio-control > * {
margin-bottom: $gap;
}
.wc-block-components-radio-control > *:last-child {
margin-bottom: 0;
}
}

.wc-block-cart__payment-options {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@
.is-large {
.wc-block-checkout__actions {
border-top: 1px solid $universal-border-light;
padding: em($gap-large) 0;
padding: $gap-larger 0;
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.wc-block-checkout__add-note {
margin: em($gap-large) 0;
margin: $gap-larger 0;
}

.is-mobile,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,15 @@
}
}
}
.wc-block-components-address-form {
.wc-block-components-checkbox {
margin-top: $gap;
}

.wc-block-components-text-input.wc-block-components-address-form__email {
&:only-child {
margin-top: 0;
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.wc-block-checkout__add-note {
margin: em($gap-large) 0;
margin: $gap-larger 0;
}

.is-mobile,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Adjust padding and margins in the editor to improve selected block outlines.
.wc-block-checkout__terms {
margin: 20px 0;
margin: $gap-larger 0;
padding-top: 4px;
padding-bottom: 4px;
display: flex;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.wc-block-checkout__terms {
margin: 1.5em 0;
margin: $gap-larger 0;

textarea {
top: -5px;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
.wp-block-woocommerce-checkout {
margin: 0;
padding-top: $gap-large;

.with-scroll-to-top__scroll-point {
top: -96px;
}
.wc-block-components-shipping-rates-control__package {
border-bottom: 0;
margin: 0 0 1em;
}
}

Expand Down