akanix42 / meteor-css-modules

MIT License
92 stars 20 forks source link

bootstrap-sass is not working propery #130

Closed csKangGdcomm closed 5 years ago

csKangGdcomm commented 5 years ago

I am using meteor-css-modules with scss.

Our projects needs bootstrap so I installed bootstrap-sass.

and then I configured package.json to include .scss files from the library.

After than I can see some styles on the screen but not everything.

Among bootstrap styles, only tag name styles is working but styles with class name is not working.

For example <legend> is styled but .btn is not styled. <legend> is from https://github.com/twbs/bootstrap-sass/blob/master/assets/stylesheets/bootstrap/_forms.scss and

.btn is from https://github.com/twbs/bootstrap-sass/blob/master/assets/stylesheets/bootstrap/_buttons.scss

Can you help me to include all the styles form bootstrap??

Thank you!

below is configuration and dev codes.

// at package.json
"cssModules": {
    "postcssPlugins": {
      "postcss-modules-values": {},
      "postcss-modules-local-by-default": {},
      "postcss-modules-extract-imports": {},
      "postcss-modules-scope": {},
      "autoprefixer": {
        "browserslist": [
          "last 2 versions"
        ]
      }
    },
    "extensions": [
      "scss"
    ],
    "ignorePaths": [
      "node_modules"
    ],
    "includePaths": [
      "node_modules/bootstrap-sass"
    ],
    "enableSassCompilation": [
      "scss"
    ],
    "parser": "postcss-scss"
  }

// on .scss
@import '{}/node_modules/bootstrap-sass/assets/stylesheets/_bootstrap.scss';
csKangGdcomm commented 5 years ago

I solved problem.

I have to put @import code in :global {} then it works. !!