baianat/hooper

Adding spacing feature.

jacksonhiew opened this issue ยท 3 comments

Is your feature request related to a problem? Please describe.
I am now using this hooper slider in my project and I want it to display some product. When I add the padding to the product, the both side of the product will not aligned. If I add negative margin in the hooper track, the left side of the slider aligned but there will be extra space at right side. Is it possible to align the both side? (sorry for my broken english lol)

Describe the solution you'd like
I was wondering whether can add padding to the slide and also align the both side of the slider?

Describe alternatives you've considered
Tried adding padding to slide and negative margin to the "hooper-track".
Tried using transparent border.
Tried adding padding to slide and negative margin to the "hooper-track" and also increase the width of the slider.

Additional context
image

in my case:

  $gap: 16px;

  .hooper {
    width: calc(100% + 2 * #{$gap});
    margin: -$gap;

    .hooper-slide {
      padding: 0 $gap;
    }
  }

hope, this helps

in my case:

  $gap: 16px;

  .hooper {
    width: calc(100% + 2 * #{$gap});
    margin: -$gap;

    .hooper-slide {
      padding: 0 $gap;
    }
  }

hope, this helps

Thank u so much ๐Ÿ‘

I'd add to .hooper container this line padding: $gap 0; to prevent height changing of .hooper container (margin: -$gap;)

$gap: 40px;

.hooper {
  width: calc(100% + 2 * #{$gap});
  margin: -$gap;
  padding: $gap 0; // THIS LINE

  .hooper-slide {
    padding: 0 $gap;
  }
}