Hey guys!
I'm using react-slick in gatsby project. I'm trying to customize the "slick-current" but I couldn't because Gatsby use a CSS Module approach.
Do we have some work around to do it? Any suggestion?
Thanks!
What is it that you're doing to customize?
Hey @laveesingh!
I would like to customize a couple of things.
The position of some slide item (I need it centered in the screen but as the style is not applied the property is not working very well) ;
I need identity the current centered item to change its style;
After some next/back event I need animate the image above the text;
Here a frame with my slider:

@flavioalves
centerMode and centerPadding for some alignments.afterChange and update your state from there:afterChange: (index) => {
this.setState({currentSlide: index});
}
<Slider>
{yourItems.map((item, index) => {
return <item className={`${index === this.currentSlide ? "activeClass": ""}`}
})}
</Slider>
afterChange can take care of your animations as well - just create your images with the corresponding indices and animate it by either adding a class or calling an animation function on it:render() {
return (<div>
<div className="image-container">
{yourImages.map((img, index) => {
return <div className={this.state.currentSlide === index ? "animate": ""}>...</div>
})}
</div>
<Slider>...</Slider>
</div>)
}
I presume the problem is solved, so I'm closing the issue.
Most helpful comment
@flavioalves
You may want to take a look at
centerModeandcenterPaddingfor some alignments.afterChangeand update your state from there:configuration
slider
afterChangecan take care of your animations as well - just create your images with the corresponding indices and animate it by either adding a class or calling an animation function on it:render