mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-22 05:18:51 +00:00
Enlarge product pictures flexibly for devices
This change will need a change of the `small` image size. The new format should be `227x227#`. The `#` crops the center of an image to make it square if necessary. All old images should then be regenerated: rake paperclip:refresh:thumbnails CLASS=Spree::Image
This commit is contained in:
@@ -15,7 +15,8 @@
|
||||
}
|
||||
|
||||
.shop-variants {
|
||||
padding-left: 7.9375rem;
|
||||
// product-thumb width + 1rem
|
||||
padding-left: calc(100% / 9 * 2 + 1rem);
|
||||
|
||||
@include breakpoint(phablet) {
|
||||
padding-left: 0;
|
||||
@@ -93,9 +94,14 @@
|
||||
}
|
||||
|
||||
.summary-header {
|
||||
padding-left: 7.9375rem;
|
||||
// product-thumb width + 1rem
|
||||
padding-left: calc(100% / 9 * 2 + 1rem);
|
||||
padding-right: 1rem;
|
||||
|
||||
@include breakpoint(phablet) {
|
||||
padding-left: calc(100% / 12 * 4 + 1rem);
|
||||
}
|
||||
|
||||
.product-producer {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
|
||||
@@ -2,9 +2,16 @@
|
||||
products {
|
||||
product {
|
||||
.product-thumb {
|
||||
width: 7rem;
|
||||
height: 7rem;
|
||||
// Desktop: the product summary is nine columns wide. Use two
|
||||
// for the image. In our design, that's a max of 192px.
|
||||
width: calc(100% / 9 * 2);
|
||||
float: left;
|
||||
|
||||
// Mobile: the summary has full twelve columns and the image
|
||||
// should take four of them. Maximum is 227px.
|
||||
@include breakpoint(phablet) {
|
||||
width: calc(100% / 12 * 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user