I've incorporated a Slider library () into my React project.
While regular CSS allows me to style the slider properly, I am facing issues when using css modules.
The tsx file looks like this:
import styles from './styles.module.css';
.
.
.
<div className={`${styles.slider} py-[8px]`}>
<Slider {...settings} />
</div>
The content of styles.module.css
is as follows:
.slider {
.slick-arrow {
z-index: 10;
top: 25% !important;
transform: unset !important;
}
}
Despite adding the class name correctly in the dev tools:
<div class="styles_slider__5dDaY py-[8px]">
<div class="slick-slider slick-initialized">
<span class="slick-arrow slick-prev slick-disabled">
.
.
.
The applied styles are missing. I'm confused why this is happening. Could it be that CSS modules do not cooperate well with external libraries?
If so, how could I go about styling the Slider
component effectively?