Skip to content
This repository was archived by the owner on Feb 23, 2024. It is now read-only.

Commit cc913e0

Browse files
authored
Fix styling issues introduced in #2597 and #2619 (#2652)
* Move order summary styles to component style.scss * Fix wrong class name in Order summary * Move express payment methods a little bit higher * Fix shipping options panel misaligned in the Cart sidebar * Add right padding to panel button so text doesn't overlap the arrow * Fix wrong class name in Order summary (II)
1 parent 1da92e2 commit cc913e0

File tree

7 files changed

+89
-94
lines changed

7 files changed

+89
-94
lines changed

assets/js/base/components/cart-checkout/order-summary/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import Panel from '@woocommerce/base-components/panel';
1010
* Internal dependencies
1111
*/
1212
import OrderSummaryItem from './order-summary-item.js';
13+
import './style.scss';
1314

1415
const OrderSummary = ( { cartItems = [] } ) => {
1516
const { isLarge, hasContainerWidth } = useContainerWidthContext();
@@ -29,7 +30,7 @@ const OrderSummary = ( { cartItems = [] } ) => {
2930
}
3031
titleTag="h2"
3132
>
32-
<div className="wc-block-order-components-summary__content">
33+
<div className="wc-block-components-order-summary__content">
3334
{ cartItems.map( ( cartItem ) => {
3435
return (
3536
<OrderSummaryItem
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
.wc-block-components-order-summary {
2+
border: 0;
3+
}
4+
5+
.wc-block-components-order-summary__content {
6+
display: table;
7+
width: 100%;
8+
}
9+
10+
.wc-block-components-order-summary-item {
11+
display: table-row;
12+
width: 100%;
13+
14+
> div {
15+
border-bottom: 1px solid $core-grey-light-600;
16+
}
17+
18+
&:last-child {
19+
> div {
20+
border-bottom: none;
21+
padding-bottom: 0;
22+
}
23+
}
24+
}
25+
26+
.wc-block-components-order-summary-item__image,
27+
.wc-block-components-order-summary-item__description {
28+
display: table-cell;
29+
vertical-align: top;
30+
}
31+
32+
.wc-block-components-order-summary-item__image {
33+
width: #{$gap-large * 2};
34+
padding-top: $gap;
35+
padding-bottom: $gap;
36+
position: relative;
37+
38+
> img {
39+
width: #{$gap-large * 2};
40+
max-width: #{$gap-large * 2};
41+
}
42+
}
43+
44+
.wc-block-components-order-summary-item__quantity {
45+
@include font-size(smaller);
46+
align-items: center;
47+
background: #fff;
48+
border: 2px solid;
49+
border-radius: 1em;
50+
box-shadow: 0 0 0 2px #fff;
51+
color: #000;
52+
display: flex;
53+
line-height: 1;
54+
min-height: 20px;
55+
padding: 0 0.4em;
56+
position: absolute;
57+
justify-content: center;
58+
min-width: 20px;
59+
right: 0;
60+
top: $gap;
61+
transform: translate(50%, -50%);
62+
white-space: nowrap;
63+
z-index: 1;
64+
}
65+
66+
.wc-block-components-order-summary-item__description {
67+
padding-left: $gap-large;
68+
padding-top: $gap;
69+
padding-bottom: $gap;
70+
line-height: 1.375;
71+
72+
p,
73+
.wc-block-product-metadata {
74+
line-height: 1.375;
75+
margin-top: #{ ( $gap-large - $gap ) / 2 };
76+
}
77+
}
78+
79+
.wc-block-components-order-summary-item__header {
80+
display: flex;
81+
flex-wrap: wrap;
82+
justify-content: space-between;
83+
}

assets/js/base/components/panel/style.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
margin-bottom: em(6px);
1313
margin-top: em(6px);
1414
padding-bottom: em($gap-small - 6px);
15+
padding-right: #{24px + $gap-smaller};
1516
padding-top: em($gap-small - 6px);
1617
position: relative;
1718
text-align: left;

assets/js/base/components/payment-methods/style.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
transform: translateY(-50%);
1616
position: absolute;
1717
top: 0;
18+
margin-top: -2px; // Same as container border width.
1819
}
1920

2021
.wc-block-components-express-checkout__content {

assets/js/base/components/sidebar-layout/style.scss

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,6 @@
2929
@include reset-box();
3030
}
3131
}
32-
33-
.wc-blocks-components-panel__button {
34-
> svg {
35-
padding-right: $gap;
36-
}
37-
}
3832
}
3933

4034
.is-medium,
@@ -58,8 +52,7 @@
5852
.is-large {
5953
.wc-block-sidebar {
6054
.wc-block-totals-table-item,
61-
.wc-blocks-components-panel__button,
62-
.wc-blocks-components-panel__content {
55+
.wc-blocks-components-panel {
6356
padding-left: $gap;
6457
padding-right: $gap;
6558
}

assets/js/blocks/cart-checkout/cart/full-cart/style.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ table.wc-block-cart-items {
266266
.wc-block-sidebar {
267267
> .wc-block-cart__totals-title,
268268
.wc-block-cart__shipping-calculator,
269-
.wc-block-shipping-totals__fieldset,
269+
.wc-block-shipping-rates-control__package:not(.wc-blocks-components-panel),
270270
> .wc-block-cart__submit-container {
271271
padding-left: $gap;
272272
padding-right: $gap;

assets/js/blocks/cart-checkout/checkout/style.scss

Lines changed: 0 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -28,90 +28,6 @@
2828
}
2929
}
3030

31-
.wc-block-components-order-summary {
32-
border: 0;
33-
}
34-
35-
.wc-block-components-order-summary__content {
36-
display: table;
37-
width: 100%;
38-
}
39-
40-
.wc-block-components-order-summary-item {
41-
display: table-row;
42-
width: 100%;
43-
44-
> div {
45-
border-bottom: 1px solid $core-grey-light-600;
46-
}
47-
48-
&:last-child {
49-
> div {
50-
border-bottom: none;
51-
padding-bottom: 0;
52-
}
53-
}
54-
}
55-
56-
.wc-block-components-order-summary-item__image,
57-
.wc-block-components-order-summary-item__description {
58-
display: table-cell;
59-
vertical-align: top;
60-
}
61-
62-
.wc-block-components-order-summary-item__image {
63-
width: #{$gap-large * 2};
64-
padding-top: $gap;
65-
padding-bottom: $gap;
66-
position: relative;
67-
68-
> img {
69-
width: #{$gap-large * 2};
70-
max-width: #{$gap-large * 2};
71-
}
72-
}
73-
74-
.wc-block-components-order-summary-item__quantity {
75-
@include font-size(smaller);
76-
align-items: center;
77-
background: #fff;
78-
border: 2px solid;
79-
border-radius: 1em;
80-
box-shadow: 0 0 0 2px #fff;
81-
color: #000;
82-
display: flex;
83-
line-height: 1;
84-
min-height: 20px;
85-
padding: 0 0.4em;
86-
position: absolute;
87-
justify-content: center;
88-
min-width: 20px;
89-
right: 0;
90-
top: $gap;
91-
transform: translate(50%, -50%);
92-
white-space: nowrap;
93-
z-index: 1;
94-
}
95-
96-
.wc-block-components-order-summary-item__description {
97-
padding-left: $gap-large;
98-
padding-top: $gap;
99-
padding-bottom: $gap;
100-
line-height: 1.375;
101-
102-
p,
103-
.wc-block-product-metadata {
104-
line-height: 1.375;
105-
margin-top: #{ ( $gap-large - $gap ) / 2 };
106-
}
107-
}
108-
109-
.wc-block-components-order-summary-item__header {
110-
display: flex;
111-
flex-wrap: wrap;
112-
justify-content: space-between;
113-
}
114-
11531
.wc-block-components-express-checkout-continue-rule {
11632
display: flex;
11733
align-items: center;

0 commit comments

Comments
 (0)