How i can set styles to center focus slide.
i want to do this example in react.js, where de center card change his style but i dont know how.

I found a css solution (but I'm not shure if there is a better solution): ".splide__slide.is-active" is the active slide
Please add this style code after the original used stylesheet (<link rel="stylesheet" type="text/css" ...)
<style>
.splide__slide{
transform: scale(0.8, 0.8); /* sets all slides to a scaling of 0.8 (80%) */
display: inline-flex; /* used for all slides vertical align center */
vertical-align: middle; /* used for all slides vertical align center */
}
.splide__slide.is-active{
transform: scale(1, 1); /* sets the active slide to scaling of 1 (100%) */
}
</style>
Use classes: https://splidejs.com/options/ i define this classes: { // Add classes for arrows. arrows: 'splide__arrows arrow', arrow: 'splide__arrow arrow', prev: 'splide__arrow--prev arrow', next: 'splide__arrow--next arrow', // pagination: 'splide__pagination position', // container page: 'splide__pagination__page position', // each button } And i change the style like this .slider .arrow svg { fill: #d25252; font-size: 10px; } .slider .position.is-active { background-color: #d25252; } .slider .position:hover { background-color: #7a7a7a; }
Sorry, but I can't help you in react.js (A JavaScript library for building user interfaces found at https://reactjs.org/
There is a bug when focus:center is active. SplideSlide's lost classes when you drag the first element and sometimes other splides dont update their class.

Update: this are my options:
{
type:"loop",
perPage: 3,
perMove: 1,
pagination: false,
arrows: false,
focus: 'center',
}
Close the issue due to the major version update. Feel free to create a new issue or open a new discussion.
To style the active slide, use the is-active class. In v3, is-prev and is-next are also available.
But I don't recommend scaling .splide__slide elements. Add an element in a slide, and style it alternatively.
<li class="splide__slide">
<div class="inner">
</div>
</li>
.splide__slide.is-active .inner {
transform: scale( 1.2 );
}
НаотошиФуджита, Спасибо Вам огромное!) долго не мог решить эьу проблему)
Use classes: https://splidejs.com/options/ i define this classes: { // Add classes for arrows. arrows: 'splide__arrows arrow', arrow: 'splide__arrow arrow', prev: 'splide__arrow--prev arrow', next: 'splide__arrow--next arrow', // pagination: 'splide__pagination position', // container page: 'splide__pagination__page position', // each button } And i change the style like this .slider .arrow svg { fill: #d25252; font-size: 10px; } .slider .position.is-active { background-color: #d25252; } .slider .position:hover { background-color: #7a7a7a; }
splide classes config here: https://splidejs.com/guides/options/#classes
Close the issue due to the major version update. Feel free to create a new issue or open a new discussion.
To style the active slide, use the
is-activeclass. In v3,is-prevandis-nextare also available. But I don't recommend scaling.splide__slideelements. Add an element in a slide, and style it alternatively..splide__slide.is-active .inner { transform: scale( 1.2 ); }
This was really helpful. I was scaling the .splide__slide elements and it was giving issues, until I came across this fix. Thanks @NaotoshiFujita