fortunar / react-sidemenu

React sidemenu component
57 stars 14 forks source link

styling issue #17

Closed 87sam12 closed 6 years ago

87sam12 commented 6 years ago

Styles are not being applied when I use react css modules and import the component and use it without explicitly including those css files. Can you pls let me know the reason for the same. My build workflow is like this:

"scripts": {
    "build-css": "node-sass-chokidar --include-path ./src --include-path ./node_modules src/ -o src/",
    "watch-css": "npm run build-css && node-sass-chokidar --include-path ./src --include-path ./node_modules src/ -o src/ --watch --recursive",
    "start-js": "node scripts/start.js",
    "start": "npm-run-all -p watch-css start-js",
    "build-js": "node scripts/build.js",
    "build": "npm-run-all build-css build-js",
    "test": "node scripts/test.js --env=jsdom"
  },
fortunar commented 6 years ago

Could you be more specific? When you inspect the html via Google Chrome inspection tools ("Elements tab") can you see classes toggling on the html when you open/collapse the menu?

1.) If you do see classes toggling it has to do with css files not being loaded or class names being wrong - not fault of the menu. 2.) If not there is something wrong with the menu - please provide the code to reproduce the issue.

eeeman1 commented 6 years ago

The problem is current, there are no styles when installing the menu component

"react-sidemenu": "0.0.14" "react": "^16.4.2", "react-dom": "^16.4.2", node -v 8.4.0 npm -v 6.1.0

fortunar commented 6 years ago

You need to include the css from "dist" folder to use default styling. You can also use less files from "less" folder if your project supports it. I will update README to make it more clear. Thanks for pointing it out.