[Help]: Center slides in case their total width is less than the container #1068
-
SummaryHello, I have a related (but not 100% same question) so I will dump it here instead of creating a new thread. I've checked out the proposed solution to the original question of this thread but it makes the carousel slides centered in all cases so also in case when there is enough slides to scroll, which is not what I want. In that case I would like to have practically So far I settled up with a bit hacky solution that sets the I've tried to go through the docs to find an option (or combination of some) that would allow for this behaviour but not found any. Probably I miss sth, though. I think it is a very basic use case to support. The codesanbox provided is the very same as the generated one (React + horizontal + left to right + 20% slide width + 10px gap + align: center) , the only thing changed is the number of slides. Any tips/helps is much appreciated 🙏 and thanks for developing and maintaining this library, it is awesome 💪 If applicable, which variants of Embla Carousel are relevant to this question?
Additional informationNo response CodeSandbox examplehttps://codesandbox.io/p/sandbox/embla-carousel-generator-react-forked-pggc54 |
Beta Was this translation helpful? Give feedback.
@sarussss I think your solution makes sense. Thanks for providing it!