React-slick: Installation instructions missing?

Created on 15 Mar 2017  路  3Comments  路  Source: akiran/react-slick

Right now the installation instructions tell us to run

npm install react-slick

and then

npm install slick-carousel

OR add a CDN link in your HTML

However, having tried to do just the first two, it's clear that this doesn't import the required CSS. What additional steps are required? Can we get them added to the instructions so less people have to ask this question?

Most helpful comment

If you're using webpack, you can import them like this:

/* In your css (if you are using css modules, make sure you import these separately as global css) */
@import "~slick-carousel/slick/slick.css";
@import "~slick-carousel/slick/slick-theme.css";

I agree that they should add the steps to the readme.

All 3 comments

If you're using webpack, you can import them like this:

/* In your css (if you are using css modules, make sure you import these separately as global css) */
@import "~slick-carousel/slick/slick.css";
@import "~slick-carousel/slick/slick-theme.css";

I agree that they should add the steps to the readme.

For me this doesn't work. I have both import statements in my scss file and it's obvious that it's still not picking the css up
@import "~/slick-carousel/slick/slick.css"; @import "~/slick-carousel/slick/slick-theme.css";

@tharrison159 I think scss has its own resolver. You have to make sure webpack handles @import resolving instead of scss if you want ~ to work. Check scss-loader's documentation.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

quarklemotion picture quarklemotion  路  4Comments

adamthewan picture adamthewan  路  4Comments

amishPro picture amishPro  路  3Comments

eternalsky picture eternalsky  路  3Comments

jfamousket picture jfamousket  路  3Comments