File tree Expand file tree Collapse file tree 8 files changed +1849
-512
lines changed
Expand file tree Collapse file tree 8 files changed +1849
-512
lines changed Original file line number Diff line number Diff line change 1+ # [ 1.0.1] ( https://github.com/rtCamp/carousel-system-interactivity-api/compare/1.0.0...1.0.1 ) (2026-02-16)
2+
3+ ### Bug Fixes
4+
5+ * ** carousel:** resolve spacing issues in loop mode where gaps were missing between last and first slide
6+ * ** carousel:** allow infinite loop in editor viewport to match frontend behavior
7+
18# 1.0.0 (2026-02-03)
29
310
Load Diff Large diffs are not rendered by default.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11{
2- "name" : " carousel-kit " ,
3- "version" : " 1.0.0 " ,
2+ "name" : " core-carousel " ,
3+ "version" : " 1.0.1 " ,
44 "description" : " Carousel block using Embla and WordPress Interactivity API" ,
55 "author" : " rtCamp" ,
66 "private" : true ,
Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ export default function Edit( {
6868 className : 'carousel-kit' ,
6969 dir : direction ,
7070 'data-axis' : axis ,
71+ 'data-loop' : loop ? 'true' : undefined ,
7172 style : {
7273 '--carousel-kit-gap' : `${ attributes . slideGap } px` ,
7374 '--carousel-kit-height' : axis === 'y' ? height : undefined ,
Original file line number Diff line number Diff line change @@ -59,6 +59,7 @@ export default function Save( {
5959 'aria-label' : ariaLabel ,
6060 dir : direction ,
6161 'data-axis' : axis ,
62+ 'data-loop' : loop ? 'true' : undefined ,
6263 'data-wp-interactive' : 'carousel-kit/carousel' ,
6364 'data-wp-context' : JSON . stringify ( context ) ,
6465 'data-wp-init' : 'callbacks.initCarousel' , // Use init for mounting
Original file line number Diff line number Diff line change 1717 margin : 0 ;
1818 padding : 0 ;
1919 list-style : none ;
20- gap : 0 ;
2120 grid-template-columns : none ;
2221 gap : var (--carousel-kit-gap , 0 );
2322}
3837 min-width : 0 ;
3938 box-sizing : border-box ;
4039
41- /* Reset vertical margins to align slides */
40+ /* Reset margins by default (use gap instead) */
41+ margin-inline-end : 0 ;
4242 margin-block-start : 0 ;
4343 margin-block-end : 0 ;
4444}
4545
46+ /* *
47+ * Fix for Embla Carousel Loop + Gap
48+ * When looping is enabled, Embla v8 doesn't support CSS 'gap'.
49+ * We switch to margin for consistent spacing in loop mode.
50+ */
51+ :where(.core-carousel [data-loop = " true" ]) .embla__container ,
52+ :where(.core-carousel [data-loop = " true" ]) .embla .wp-block-post-template {
53+ gap : 0 ;
54+ }
55+
56+ :where(.core-carousel [data-loop = " true" ]) .embla__slide ,
57+ :where(.core-carousel [data-loop = " true" ]) .embla .wp-block-post-template li {
58+ margin-inline-end : var (--core-carousel-gap , 0 );
59+ }
60+
4661/* Vertical Axis adjustments */
4762:where(.carousel-kit [data-axis = " y" ]) {
4863 display : flex ;
6681 max-width : 100% ;
6782 margin-inline-end : 0 ;
6883}
84+
85+ /* Vertical + Loop specific */
86+ :where(.core-carousel [data-axis = " y" ][data-loop = " true" ]) .embla__slide ,
87+ :where(.core-carousel [data-axis = " y" ][data-loop = " true" ]) .embla .wp-block-post-template li {
88+ margin-block-end : var (--core-carousel-gap , 0 );
89+ }
Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ export default function Edit( {
8181 const options = carouselOptions as any ;
8282
8383 embla = EmblaCarousel ( emblaRef . current ! , {
84- loop : false ,
84+ loop : options ?. loop ?? false ,
8585 dragFree : options ?. dragFree ?? false ,
8686 containScroll : options ?. containScroll || 'trimSnaps' ,
8787 axis : options ?. axis || 'x' ,
You can’t perform that action at this time.
0 commit comments