Ability to not add padding to the first and last element with offset
See original GitHub issueIs your feature request related to a problem? Please describe.
When making use of the offset
property for a Carousel
it would be useful to not apply the offsets to the left of the first element and to the right of the last element so the sizing/flow is in line with the rest of the page flow
Describe the solution you’d like A boolean flag that allows you to toggle the spacing on or off
Describe alternatives you’ve considered I have tried to selectively apply the spacing to the elements using padding/margin but this changes the space taken by the element and messes with the aspect ratios. It is possible to do this using the negative spacing on the container but it would be useful to not have to do this and retain all the logic in the carousel itself
Additional context None
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7 (4 by maintainers)
Top GitHub Comments
Thanks @nabeelvalley
this example is very useful.
@piotr-s-brainhub Here’s some code which shows the extra space on the left and right side (current behaviour)
This is from the documentation with the above code:
I’m suggesting to instead, using a configuration option, get something like this which is done using negative margins on the container, but this isn’t really a usable solution as it alters the size and spacing of the elements. A similar issue happens when applying the spacing to the children directly
The other issue I mentioned above is when applying padding to the children so they can be spaced correctly but this doesn’t really work well as there’s no easy way to how much spacing the child should have and this causes the children to become different sizes