Skip to content

Commit 9c81433

Browse files
committed
Fix issue widget recent view product not fit in mobile
1 parent d7cf188 commit 9c81433

File tree

1 file changed

+49
-25
lines changed
  • app/design/frontend/Magento/blank/Magento_Catalog/web/css/source

1 file changed

+49
-25
lines changed

app/design/frontend/Magento/blank/Magento_Catalog/web/css/source/_widgets.less

Lines changed: 49 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
.block.widget {
2626
.products-grid .product-item {
2727
margin-left: 2%;
28-
width: calc(~'(100% - 2%)/2');
28+
width: calc(~'(100% - 2%) / 2');
2929

3030
&:nth-child(2n + 1) {
3131
margin-left: 0;
@@ -63,19 +63,45 @@
6363
// Mobile
6464
// _____________________________________________
6565

66-
.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__s) {
66+
.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) {
6767
.block.widget .products-grid .product-item,
6868
.page-layout-1column .block.widget .products-grid .product-item,
6969
.page-layout-3columns .block.widget .products-grid .product-item {
7070
width: 100%/3;
7171
}
7272

73-
.page-layout-1column .block.widget .products-grid .product-item {
74-
margin-left: 2%;
75-
width: calc(~'(100% - 4%)/3');
73+
.sidebar .block-viewed-products-grid {
74+
.products-grid {
75+
.product-item {
76+
margin-left: 2%;
77+
width: calc(~'(100% - 2%) / 2');
7678

77-
&:nth-child(3n + 1) {
78-
margin-left: 0;
79+
&:nth-child(2n + 1) {
80+
margin-left: 0;
81+
}
82+
}
83+
84+
.product-item-photo {
85+
display: block;
86+
position: relative;
87+
}
88+
89+
.product-item-details {
90+
margin: 0;
91+
}
92+
93+
.product-item-info {
94+
width: auto;
95+
text-align: center;
96+
97+
.product-item-actions {
98+
display: inline-block;
99+
}
100+
}
101+
102+
.product-item-description {
103+
margin: 10px 0;
104+
}
79105
}
80106
}
81107
}
@@ -101,7 +127,7 @@
101127

102128
.page-layout-1column .block.widget .products-grid .product-item {
103129
margin-left: 2%;
104-
width: calc(~'(100% - 6%)/4');
130+
width: calc(~'(100% - 6%) / 4');
105131

106132
&:nth-child(3n + 1) {
107133
margin-left: 2%;
@@ -115,6 +141,20 @@
115141
.page-layout-3columns .block.widget .products-grid .product-item {
116142
width: 100%/2;
117143
}
144+
145+
.sidebar .block.widget .pager {
146+
.item:not(.pages-item-next):not(.pages-item-previous) {
147+
&:extend(.abs-no-display-desktop all);
148+
}
149+
150+
.pages-item-next {
151+
padding: 0;
152+
153+
.action {
154+
margin: 0;
155+
}
156+
}
157+
}
118158
}
119159

120160
.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__l) {
@@ -124,7 +164,7 @@
124164

125165
.page-layout-1column .block.widget .products-grid .product-item {
126166
margin-left: 2%;
127-
width: calc(~'(100% - 8%)/5');
167+
width: calc(~'(100% - 8%) / 5');
128168

129169
&:nth-child(4n + 1) {
130170
margin-left: 2%;
@@ -153,19 +193,3 @@
153193
}
154194
}
155195
}
156-
157-
.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) {
158-
.sidebar .block.widget .pager {
159-
.item:not(.pages-item-next):not(.pages-item-previous) {
160-
&:extend(.abs-no-display-desktop all);
161-
}
162-
163-
.pages-item-next {
164-
padding: 0;
165-
166-
.action {
167-
margin: 0;
168-
}
169-
}
170-
}
171-
}

0 commit comments

Comments
 (0)