From 6f5672605094a44ac913acbe826e87f090d3105d Mon Sep 17 00:00:00 2001 From: Trias Nur Rahman Date: Mon, 18 Nov 2019 15:24:25 +0700 Subject: [PATCH 1/2] Add option to remove spacing at the end --- flexbin.scss | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/flexbin.scss b/flexbin.scss index da00032..f258570 100644 --- a/flexbin.scss +++ b/flexbin.scss @@ -10,6 +10,8 @@ $flexbin-phone-max: 400px !default; $flexbin-row-height-phone: 100px !default; $flexbin-space-phone: $flexbin-space !default; +$flexbin-add-end-space: false; + // Minxin for customize multiple Flexbin layout // For example, 300px height for desktop devices, 150px height for mobile devices @mixin flexbin($row-height, $space) { @@ -20,11 +22,13 @@ $flexbin-space-phone: $flexbin-space !default; // Let final row align left fit if images are not enough to fill // If the gap is very small, fill the final row - &:after { - content: ''; - flex-grow: 999999999; // avoid final row zoom too much to fit width - min-width: $row-height; // avoid small gap in final row (< $row-height) - height: 0; + @if $flexbin-add-end-space { + &:after { + content: ''; + flex-grow: 999999999; // avoid final row zoom too much to fit width + min-width: $row-height; // avoid small gap in final row (< $row-height) + height: 0; + } } > * { @@ -66,5 +70,3 @@ $flexbin-space-phone: $flexbin-space !default; @include flexbin($flexbin-row-height-phone, $flexbin-space-phone); } } - - From 1a434554cca0738b3a29dce3e9db86d22c8c1592 Mon Sep 17 00:00:00 2001 From: Trias Nur Rahman Date: Mon, 18 Nov 2019 15:24:43 +0700 Subject: [PATCH 2/2] Fix margin and padding --- flexbin.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flexbin.scss b/flexbin.scss index f258570..1f3ca0d 100644 --- a/flexbin.scss +++ b/flexbin.scss @@ -18,7 +18,8 @@ $flexbin-add-end-space: false; display: flex; overflow: hidden; flex-wrap: wrap; - margin: - $space / 2; + margin: 0 (-1 * $space / 2); + padding: 2.5px 0; // Let final row align left fit if images are not enough to fill // If the gap is very small, fill the final row