Skip to content

Commit e074ae5

Browse files
author
Hwashiang Yu
committed
MC-4096: Product Content Type doesn't wrapped inside tiny Column
- Updated less to make products inside column responsive
1 parent 9a9a039 commit e074ae5

File tree

2 files changed

+46
-9
lines changed
  • app/code/Magento/PageBuilder/view

2 files changed

+46
-9
lines changed

app/code/Magento/PageBuilder/view/adminhtml/web/css/source/content-type/products/_default.less

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,21 @@
3838

3939
.product-item {
4040
display: inline-block;
41-
min-width: 200px;
41+
max-width: 100%;
42+
min-width: 50px;
4243
padding-left: 20px;
4344
vertical-align: top;
44-
width: 100%/4;
45+
width: 200px;
4546

4647
&:extend(.abs-add-box-sizing all);
4748

4849

4950
.price-box {
5051
margin: @indent__s 0 @indent__m;
52+
word-wrap: break-word;
5153

5254
.price {
5355
font-weight: @font-weight__bold;
54-
white-space: nowrap;
5556
}
5657

5758
.price-label {
@@ -90,13 +91,13 @@
9091
}
9192

9293
.actions-primary {
93-
display: table-cell;
94+
display: inline-block;
95+
max-width: 100%;
9496

9597
+ .actions-secondary {
96-
display: table-cell;
98+
display: inline-block;
9799
padding-left: 10px;
98100
vertical-align: middle;
99-
width: 50%;
100101

101102
> .action {
102103
color: @color-very-dark-gray;
@@ -115,13 +116,17 @@
115116
}
116117

117118
.action {
119+
max-width: 100%;
118120
&.tocart {
119121
.lib-font-size(13px);
120122
border-radius: 0;
121123
line-height: 1;
122124
padding-bottom: @indent__s;
123125
padding-top: @indent__s;
124-
white-space: nowrap;
126+
> span {
127+
white-space: normal;
128+
word-wrap: break-word;
129+
}
125130
}
126131

127132
&.primary {
@@ -283,7 +288,7 @@
283288
.pagebuilder-products {
284289
.product-item {
285290
margin-left: calc(~'(100% - 5 * (100%/6)) / 4');
286-
width: 100%/6;
291+
//width: 100%/6;
287292

288293
&:nth-child(4n + 1) {
289294
margin-left: calc(~'(100% - 5 * (100%/6)) / 4');

app/code/Magento/PageBuilder/view/frontend/web/css/source/content-type/products/_default.less

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,39 @@
1010
.pagebuilder-column {
1111
.widget-product-grid {
1212
.product-item {
13-
min-width: 200px;
13+
max-width: 100%;
14+
min-width: 50px;
15+
.price-box {
16+
word-wrap: break-word;
17+
.price {
18+
white-space: normal;
19+
}
20+
}
21+
.product-item-actions {
22+
.actions-primary {
23+
display: inline-block;
24+
max-width: 100%;
25+
}
26+
.actions-secondary {
27+
display: inline-block;
28+
width: auto;
29+
}
30+
.tocart {
31+
max-width: 100%;
32+
white-space: normal;
33+
}
34+
}
35+
}
36+
}
37+
[data-role='products'] {
38+
.block.widget {
39+
.products-grid {
40+
.widget-product-grid.product-items {
41+
.product-item {
42+
width: 200px;
43+
}
44+
}
45+
}
1446
}
1547
}
1648
}

0 commit comments

Comments
 (0)