Open ciampo opened 6 years ago
Can the new CSS scroll snap control may helps?
It could, but it may also require deep refactoring. Also, the new version of the spec is not supported by many browsers, so it would require a fallback solution
Btw this can be done easily by composing in the light dom. Users can define slider with a single centered content. Something like this:
<style>
div {
display: flex; /* or grid */
justify-content: center;
}
</style>
<macro-carousel>
<div> [Centered Content] </div>
<div> [Centered Content] [Centered Content] </div>
<div> [Centered Content] </div>
</macro-carousel>
By "centered slides" I meant something like this (hope it helps explaining the idea):
The selected slide would be in the middle of the view. This would require a few changes to how the carousel works.