Repository navigation
[Feat]: CSS-only Mode #1112
Replies: 1 comment
|
Hi @MentalGear, Thank you for your feature request! I know there are carousel libraries that support this, but I personally believe it’s not the best approach. As you mentioned, browser support for this feature is solid now, so that’s not the issue. The real challenge is that adding a CSS-only mode would severely limit the existing API. Many of Embla’s current features wouldn’t be available in that mode. On top of that, it would increase code complexity significantly—essentially requiring two separate carousel libraries in one codebase. This would not only complicate things internally, but also increase the bundle size, impacting users who don’t need or want this feature. I believe a JavaScript carousel and a CSS carousel serve different purposes. While CSS-only options are more limited, they can’t offer the same flexibility and features that a JavaScript-powered carousel can. Embla is already smooth on most devices, and I don’t see enough benefit in adding a CSS mode. I hope that makes sense. |
Uh oh!
There was an error while loading. Please reload this page.
Which variants of Embla Carousel are relevant to this feature request?
Feature description
First, thank you for your great work on the carousel component! With web browser support for scroll snapping being so high these days, it would be fantastic to have an option to enable a CSS-only mode. This would help match the native scrolling behavior of each platform, providing a smoother experience overall.
Additionally, this approach would allow us to reduce dependencies by compiling the carousel with less overhead, making the overall size lighter. With scroll snapping and element.scrollTo handling all the scrolling, we could eliminate the need for animationRequest, further simplifying the implementation.
It would be great if this could be considered for a future update!
Additional Context
Additional details here...
Before submitting
All reactions